PDA

View Full Version : C++ help plz?


sirf _tum
04-11-2007, 02:51 PM
i intitialize an array of 100 elements of integer type which reads data from a file but file has only 10 elements what should be the condition of while statement that terminate after the 10th element
like
while(index

Jyaif
04-11-2007, 04:02 PM
If you are using the fstream class to read the file, use the eof() method:

fstream f("foo.txt",ios::in);
while(index