Jul 15, 2011 at 11:06am
Have you checked that you don't read more than 3 lines, which would cause a bufffer overflow?
Jul 15, 2011 at 11:08am
oh wow, I'm stupid. My array that I was storing it in wasn't big enough......
is there any way to check how many lines the file is, and put that as the array size?
Jul 15, 2011 at 11:15am
Not without parsing the whole file first. But you can use a vector of strings, which will resize itself as you add strings to it