Thread: file IO
View Single Post
Old Mar 22nd, 2008, 5:36 PM   #2
Ancient Dragon
PFO God In Training
 
Ancient Dragon's Avatar
 
Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 600
Rep Power: 4 Ancient Dragon is on a distinguished road
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().
while(file_in >> r[i]) 
{ 
 cout<<r[i]<<endl; 
i++; 
}
__________________
<<Freelance Programmer>> << Hobby Site>>
Ancient Dragon is offline   Reply With Quote