Folks,
Most of you can see what the below segment of code is doing, the problem I have is that the program is skipping the next line in the source file (airportsMaster) after it has processed a successful match.
Is the problem because I am using getline twice or that my ignore length is wrong?
while ( !airportsMaster.eof())
{
airportsMaster.getline(icaoChr, 5,',');
for ( int i=0; i<(numAirports); i++ )
{
if (icaoChr == icaoStr[i])
{
airportsList << icaoStr[i] << ",";
airportsMaster.getline(tempChr, 35,'\n');
airportsList << tempChr << "\n";
}
}
airportsMaster.ignore(35, '\n');
}
The source file (a simple .txt file) contains 26000+ lines in format like below ...
SKTM,N6* 27.18',W71* 45.69',1050
SKTQ,N0* 43.60',W75* 12.92',597
SKTU,N8* 3.98',W76* 44.88',7
SKUA,N5* 28.41',W68* 41.13',285
as you can see the length varies between 29-34 char.