// Attempt to declare a string object
#include <iostream>
#include <string>
#include <vector>
int main()
{
std::string const end_input('END');
std::vector<std::string> words;
std::string aword;
}
Errors:
Compiling: main.cpp
/home/tutorial/chapter3/exe2/main.cpp:9:29: warning: multi-character character constant
/home/tutorial/chapter3/exe2/main.cpp: In function ‘int main()’:
/home/tutorial/chapter3/exe2/main.cpp:9: error: no matching function for call to ‘std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(int)’
/usr/lib/gcc/i586-manbo-linux-gnu/4.3.2/../../../../include/c++/4.3.2/bits/basic_string.tcc:226: note: candidates are: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(typename _Alloc::rebind<_CharT>::other::size_type, _CharT, const _Alloc&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]
/usr/lib/gcc/i586-manbo-linux-gnu/4.3.2/../../../../include/c++/4.3.2/bits/basic_string.tcc:219: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>] <near match>
/usr/lib/gcc/i586-manbo-linux-gnu/4.3.2/../../../../include/c++/4.3.2/bits/basic_string.tcc:212: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, typename _Alloc::rebind<_CharT>::other::size_type, const _Alloc&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]
/usr/lib/gcc/i586-manbo-linux-gnu/4.3.2/../../../../include/c++/4.3.2/bits/basic_string.tcc:201: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::basic_string<_CharT, _Traits, _Alloc>&, typename _Alloc::rebind<_CharT>::other::size_type, typename _Alloc::rebind<_CharT>::other::size_type, const _Alloc&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]
/usr/lib/gcc/i586-manbo-linux-gnu/4.3.2/../../../../include/c++/4.3.2/bits/basic_string.tcc:190: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::basic_string<_CharT, _Traits, _Alloc>&, typename _Alloc::rebind<_CharT>::other::size_type, typename _Alloc::rebind<_CharT>::other::size_type) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]
/usr/lib/gcc/i586-manbo-linux-gnu/4.3.2/../../../../include/c++/4.3.2/bits/basic_string.tcc:176: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]
/usr/lib/gcc/i586-manbo-linux-gnu/4.3.2/../../../../include/c++/4.3.2/bits/basic_string.tcc:184: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Alloc&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]
/usr/lib/gcc/i586-manbo-linux-gnu/4.3.2/../../../../include/c++/4.3.2/bits/basic_string.h:2067: note: std::basic_string<_CharT, _Traits, _Alloc>::basic_string() [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]
Process terminated with status 1 (0 minutes, 1 seconds)
1 errors, 1 warnings