e3.14.cpp: In function ‘int main()’:
e3.14.cpp:10:13: error: ‘string’ was not declared in this scope
e3.14.cpp:10:19: error: template argument 1 is invalid
e3.14.cpp:10:19: error: template argument 2 is invalid
e3.14.cpp:10:22: error: invalid type in declaration before ‘;’ token
e3.14.cpp:15:22: error: request for member ‘push_back’ in ‘v’, which is of non-class type ‘int’
e3.14.cpp:19:17: error: ‘string’ cannot appear in a constant-expression
e3.14.cpp:19:23: error: template argument 1 is invalid
e3.14.cpp:19:23: error: template argument 2 is invalid
e3.14.cpp:19:36: error: expected initializer before ‘i’
e3.14.cpp:19:41: error: name lookup of ‘i’ changed for ISO ‘for’ scoping
e3.14.cpp:19:41: note: (if you use ‘-fpermissive’ G++ will accept your code)
e3.14.cpp:19:46: error: request for member ‘size’ in ‘v’, which is of non-class type ‘int’
e3.14.cpp:20:17: error: invalid types ‘int[std::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type]’ for array subscript
if I change the comment of
//using namespace std;
then it works. can any body tell me how to fix this if I don't want to use namespace. thanks!