can anyone tell me if this will actually read off float values from a text file: (only posting bits of the code)
i've implemented it but i get glitches in the answers...like if i have 139.6 in the file i get a value of x = 138.99876 smth...i think it's something to do with the spaces...consider this format which i read...Code:ifstream fin ("inputfile.txt");
//then we read from file and store in a float x...imagine that the file has only several numbers...
fin >> x;
in the file: 126.9 130.0 145.0 166.8
when i read it in i get 125.88888943673 129.99983783 etc etc...
Thanks,
Farooq
