A
arnuld
in C++ Primer 4/3 Lippman says in chapter 3, section 3.3.1:
vector<string> svec(10);
// 10 elements, each an empty string
here is the the code output & output from my Debian box running "gcc
3.3.5":
#include <iostream>
#include <vector>
#include <string>
int main() {
std::vector<string> svec(10);
// std::cout << v_str << std::endl;
return 0;
}
/* OUTPUT
unix@debian:~/programming/cpp$ g++ -ansi test-programme.cpp
test-programme.cpp: In function `int main()':
test-programme.cpp:6: error: `string' undeclared (first use this
function)
test-programme.cpp:6: error: (Each undeclared identifier is reported
only once
for each function it appears in.)
test-programme.cpp:6: error: template argument 1 is invalid
test-programme.cpp:6: error: template argument 2 is invalid
test-programme.cpp:6: error: ISO C++ forbids declaration of `svec' with
no type
unix@debian:~/programming/cpp$
*/
where is the trouble?
"arnuld"
vector<string> svec(10);
// 10 elements, each an empty string
here is the the code output & output from my Debian box running "gcc
3.3.5":
#include <iostream>
#include <vector>
#include <string>
int main() {
std::vector<string> svec(10);
// std::cout << v_str << std::endl;
return 0;
}
/* OUTPUT
unix@debian:~/programming/cpp$ g++ -ansi test-programme.cpp
test-programme.cpp: In function `int main()':
test-programme.cpp:6: error: `string' undeclared (first use this
function)
test-programme.cpp:6: error: (Each undeclared identifier is reported
only once
for each function it appears in.)
test-programme.cpp:6: error: template argument 1 is invalid
test-programme.cpp:6: error: template argument 2 is invalid
test-programme.cpp:6: error: ISO C++ forbids declaration of `svec' with
no type
unix@debian:~/programming/cpp$
*/
where is the trouble?
"arnuld"