B
bg
hi all,
i need to parse a text file, making several passes over it. I'm doing
something like this:
ifstream input(args[2]);
......
string line;
while(getline(input,string)) // first pass works ok
{
...
}
// reset fpos to beginning of input and parse again
input.seekg(0,ios::beg);
while(getline(input,string)) // second pass - never enters
{
...
}
the problem i'm seeing is that the second while is never entered,
presumaby because i'm not resetting the file back to the begining
correclty?
whats the correct way?
TIA
i'm using xcode 1.2/gcc 3.3?
bg
i need to parse a text file, making several passes over it. I'm doing
something like this:
ifstream input(args[2]);
......
string line;
while(getline(input,string)) // first pass works ok
{
...
}
// reset fpos to beginning of input and parse again
input.seekg(0,ios::beg);
while(getline(input,string)) // second pass - never enters
{
...
}
the problem i'm seeing is that the second while is never entered,
presumaby because i'm not resetting the file back to the begining
correclty?
whats the correct way?
TIA
i'm using xcode 1.2/gcc 3.3?
bg