Hi all, just wondering if someone can tell me what i might be doing wrong here ...
I'm trying to read in numbers from a text file into variables and display them back on the screen. However after i read them and output them, they are not the same. Here is what the input would looklike
and here is the outputCode:
****************************************
****************************************
****************************************
X 362741.5 5606219.4 896.6
X 362731.9 5606201.4 896.2
X 362722.8 5606184.1 895.8
so only the last set of numbers stays the same ?Code:
362742 5.60622e+006 896.6
362732 5.6062e+006 896.2
362723 5.60618e+006 895.8
here is some of the code im using ...
any help would be great :)Code:...
char byte;
double xcoord;
double ycoord;
double elevation;
for(;;)
{
inFile.read(&byte, 1);
if(inFile.eof() == true)
{
break;
}
if(byte == '*')
{
skipLine(inFile);
}
else if(byte == 'X')
{
inFile >> xcoord;
inFile >> ycoord;
inFile >> elevation;
}
}
...