B
Brian Ronk
I'm having a strange error. I have a Debian stable server and I'm
using gcc 3.3, but it looks like I have 3.4 installed as well. I
recently made a change to a program that takes data from two files and
converts it into csv format so the final files don't have an extension
of any kind. When I did this, I began having problems with one of my
input files. This file is scanned through, and then it is returned to
the beginning at the beginning of my loop. It looks like the seekg
that I'm using is failing. Here's the line that I'm using:
// stateData is the name of the input file variable
stateData.seekg(0, ios::beg);
// I also tried stateData.seekg((streamoff) 0), but it didn't help.
Unfortunetly, I haven't been doing much programming recently, so I'm
getting a bit rusty, and I dont' know some of the newer features
(namespaces and some more advanced things like that). I've been trying
to figure out what's going on with no success, all I know is that
statData.tellg() is -1 after 1 run through of the file. The first loop
goes fine, and stops in the middle of the file, the next gives me -1.
If anyone can point me in some sort of direction, that would be great.
Thanks.
using gcc 3.3, but it looks like I have 3.4 installed as well. I
recently made a change to a program that takes data from two files and
converts it into csv format so the final files don't have an extension
of any kind. When I did this, I began having problems with one of my
input files. This file is scanned through, and then it is returned to
the beginning at the beginning of my loop. It looks like the seekg
that I'm using is failing. Here's the line that I'm using:
// stateData is the name of the input file variable
stateData.seekg(0, ios::beg);
// I also tried stateData.seekg((streamoff) 0), but it didn't help.
Unfortunetly, I haven't been doing much programming recently, so I'm
getting a bit rusty, and I dont' know some of the newer features
(namespaces and some more advanced things like that). I've been trying
to figure out what's going on with no success, all I know is that
statData.tellg() is -1 after 1 run through of the file. The first loop
goes fine, and stops in the middle of the file, the next gives me -1.
If anyone can point me in some sort of direction, that would be great.
Thanks.