from a file and putting it in the vector. On the third item read in,
it reaches the .push_back code. However, after that, I use .size(),
and it says that it only has two items. This is bizarre. Any
thoughts?
Code fragment may be found below. Thanks, Alan
while (inFile >sensed_data.time >sensed_data.sensor_who >>
sensed_data.aircraft_who
sensed_data.ycor>sensed_data.IFF >sensed_data.xcor >>
sensed_data.course>sensed_data.altitude >sensed_data.speed >>
{>sensed_data.Track_Quality)
// cout << "Reading input file\n";
if (sensed_data.time == last_clock)
{
cout << "Adding report to list\n";
cout << "Data to add: " << sensed_data.sensor_who << " "
<< sensed_data.aircraft_who << "\n";
sensor_reports.push_back (sensed_data);
cout << "# sensor reports = " << sensor_reports.size() <<
"\n";
}