Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C++ File Input to Vector

Name: foreach(nigger in Africa) 2011-12-15 1:12

Well /prog/ I'm trying to read a text file line-by-line into a vector. Is there some sort of inherent vector size limitation I don't know about?

Protip: The file has 23,000 lines. :S

(I've tested it by trying to output the first 1 or 2 vector elements after the loop, but shit just breaks because there's nothing in it??)

Name: Anonymous 2011-12-16 6:34

>>24
This reference should always be valid. Therefore, the loop should loop forever.... Maybe it's converted to a void *?
Yes. ifstream defines a ` void * operator` which returns a non-null if the file is readable or null if the file is not open or there are no more data or an error occurred.

>>17
Except therein lies the problem. As far as the debugger or anyone is concerned, this program SHOULD work.
Are you retarded? Do you understand what a "debugger" is? You don't ask the debugger what it is concerned about, you run a program in the debugger and see why it doesn't work.

Or you can add `printf("%d\n", myFile.is_open());` and see that you failed to put the file in the same directory as your program, you fucking retarded moron.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List