hi guys...
I have a little trouble, I´m reading from a file with ifstram, since I want to review the format of this file...
however when I use file.oef() in my loop, my program read the last data two times! :-(( do U know what happens?
my code is:
¦float val1;
¦int fin;
¦
¦ifstream hoyos("hoyo"
¦
¦if (!hoyos.fail())
¦ {
¦
¦ while (!hoyos.eof())
¦ {
¦ cout << "si se pudo abrir el archivo!\n";
¦ hoyos >> val1;
¦ cout << "valor de val1: " << val1 << "\n";
¦ getch();
¦ };
¦
my trouble is if my file is :
1 2 3 4
5 6 7 8
my program lists:
1
2
3
4
5
6
7
8
8
two times the last one!
why??!!!
I hope U can help me... please...
rick