File question
I want to store the content of a file into a matrix of strings and I need the number of lines from the file(at the begining, right after opening the file!) to initialize the matrix. How can I get that number?
[215 byte] By [
Tibi21a] at [2007-11-27 6:15:56]

> I want to store the content of a file into a matrix
> of strings and I need the number of lines from the
> file(at the begining, right after opening the file!)
> to initialize the matrix. How can I get that number?
You can't without reading the file. A file does not contain information on how many lines there are.
Kaj
kajbja at 2007-7-12 17:27:07 >

If you are the one writing the file, a good practice (at least in my experience) is to make the very first line of the file the "How Many" number. In programming competitions, arrays and lists are initialized according to the first integer given in a series of input.
tk393a at 2007-7-12 17:27:07 >
