Date: Fri, 4 Jul 1997 02:25:39 -0400 (EDT) From: Timothy Robb To: djgpp AT delorie DOT com Subject: vector problem Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk The following vector test program of mine is giving me some problems. Mainly it won't compile and give me about 50k of errors/warnings. It's suppossed to read in a text file to a vector and then latter display it, which it sadly does under VC++ 5.0 How do I get it to work under g++? I'm using g++ 2.7.2.2 with SGI's latest STL headers under Linux. Timothy Robb #include #include #include #include #include using namespace std; int main(int argc,char *argv[]) { if( argc < 2 ) { cerr << "Requires a file to read in. " << endl; exit(75); } ifstream infile(argv[1]); assert(infile); string instring; vector invec; while( !infile.eof() ) { getline(infile, instring); invec.push_back(instring); } vector::iterator it; for( it = invec.begin(); it != invec.end(); it++) cout << *it << endl; return 0; }