-
Oops, missed an include (my bad)!
#include <vector>
Edit: And do NOT!!!! do this: "#include <iostream.h>"
Instead, do this: "#include <iostream>"
The first isn't legal C++, nor is it what you want. It's also totally unnecessary to include either, as <fstream> will probably include <iostream> itself.
-
>>It's also totally unnecessary to include either, as <fstream> will probably include <iostream> itself.
No,test with VS 2003.
Nothing in the C++ Standard states that one standard includes another standard header.
Every implementation has it's own rules.
-
Hmm, you're right, VS .NET doesn't include <iostream>. I know it's always implementation defined, so you're right, for maximum portability you should explicitly include everything.
-
<fstream> will have already included basic_ostream and basic_istream, but should not have defined the symbols cout and cin.
fstream = basic_fstream derives from basic_ifstream & basic_ofstream
basic_ofstream derives basic_ostream
basic_ifstream derives from basic_istream
cout is an ostream (= basic_ostream)
cin is an istream (= basic_istream)
-