hi...i'm trying to create a program that takes a text file and reads the first line.
i can do it fine in using c style strings (char) but how can i do it using strings?
so far i'm thinking something like...
currently i'm using infile.getline(line, 100); and it works.Code:while(!infile.eof()) { // i need a line here to recognize the end of line infile >> line; outfile << line << endl; cout << line << endl; }
thanks,
barneygumble742



LinkBack URL
About LinkBacks



You can even put it in the loop condition and everything will "just work", thus solving your actual question, and the logic error that I just described:
I used to be an adventurer like you... then I took an arrow to the knee.