Inner loop is executing as many times as there is line in regarding files. But outer loop is executing only once, regardless of there are other line presence in regarding files.I want to compare values from each line of first file (containing m lines) with each line of second file (containing n lines) . how to iterate loop m X n times ?
ifstream gpsfixinput, geofenceinput;
gpsfixinput.open(GPSFIX_FILE, ios_base::in);
geofenceinput.open( GEOFENCE_FILE, ios_base::in);
string gline,lline ;
while(getline(gpsfixinput, lline))
{
istringstream lin(lline);
double lat,lon;
lin >> lat >> lon ;
while(getline(geofenceinput, gline))
{
istringstream gin(gline);
double glat, glon, rad;
string alert;
gin >> glat >> glon >> rad >>alert;
distance(lat,lon, glat, glon , rad , alert );
}