M mosdef Banned May 14, 2000 2,253 0 0 Mar 7, 2001 #1 Any C++ experts out there that I could speak online with about a program I'm struggling with? Thanks. -mosdef
Any C++ experts out there that I could speak online with about a program I'm struggling with? Thanks. -mosdef
B BCYL Diamond Member Jun 7, 2000 7,803 0 71 Mar 7, 2001 #2 What are you having trouble with? You might wanna post your problem here so more ppl can give you feedbacks...
What are you having trouble with? You might wanna post your problem here so more ppl can give you feedbacks...
M mosdef Banned May 14, 2000 2,253 0 0 Mar 7, 2001 #3 Ok I figured out what the problem is, but how should I solve it? I'm reading in characters from a file. while( !inAirlines.eof() ) { ... } Will this detect eof? Also, what's the best way to get to the next line in the file? -mosdef
Ok I figured out what the problem is, but how should I solve it? I'm reading in characters from a file. while( !inAirlines.eof() ) { ... } Will this detect eof? Also, what's the best way to get to the next line in the file? -mosdef
M mosdef Banned May 14, 2000 2,253 0 0 Mar 7, 2001 #4 If anyone out there is reading this please IM me at mmmosdef. -mosdef
S SnoopCat Senior member Jan 19, 2001 926 0 0 Mar 7, 2001 #5 ifstream instream; string s; vector<string> storage; int i =0; instream.open(dafilename.c_str()) if (instream.fail()) { cout << "the file was unable to be opened"; return; } while(!instream.fail()) { storage.push_back(s); getline(instream,s); i++; } instream.close; for (int x=0; x <=instream.size(); x++) { cout << storage[x] << endl; } return; }
ifstream instream; string s; vector<string> storage; int i =0; instream.open(dafilename.c_str()) if (instream.fail()) { cout << "the file was unable to be opened"; return; } while(!instream.fail()) { storage.push_back(s); getline(instream,s); i++; } instream.close; for (int x=0; x <=instream.size(); x++) { cout << storage[x] << endl; } return; }