File I/O Problem
Posted on 2000-03-01
I'm working on a programming assignment on OpenGL using C++. The assignment involves drawing a 3d image and texture mapping it using vertex and polygon data from a file.
The problem is that my solution involves saving the position of the pointer in the file performing other operations later on in the file and then returning back to the saved position. I am using something like below:
//I input the data as following
InFile >> fl;
//at the point I want to save the file pointer
pos = Infile.tellg();
For some reason this does not work properly. A small section showing the layout of the data file is shown below:
0 -0.2048 -0.090616 0 -0.204 -0.090824 0 -0.2032 -0.09104
0 -0.2024 -0.091256 0 -0.2016 -0.091464 0 -0.2008 -0.09168
The file size is about 2MB.
I'm using Visual Studio in Win 98
Any help appreciated.