Thread
:
file IO
View Single Post
Mar 22nd, 2008, 5:36 PM
#
2
Ancient Dragon
PFO God In Training
Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 600
Rep Power:
4
Re: file IO
>>Why is this number appearing and for what reason??
Because you are using feof() incorrectly on line 10. Rearrange your program like below. You rarely, if ever, have to use feof().
(
Toggle Plain Text
)
while(file_in >> r[i]) { cout<<r[i]<<endl; i++; }
while(file_in >> r[i]) { cout<<r[i]<<endl; i++; }
__________________
<<
Freelance Programmer
>> <<
Hobby Site
>>
Ancient Dragon
View Public Profile
Find More Posts by Ancient Dragon