Hi there
I need help writing a data structure to hold and assign data to a particular unique ID.
I think I want an vector of structures:
struct Data {
int ID;
double latitude;
double longitude;
int speed;
int altitude;
};
I receive messages in the above format, they can come in a mixture BUT each one will have a Unique ID at the beginning of the message.
Example:
56885 53.56 -8.5 //ID LAT LONG
48569 52.5 -0.3 //ID LAT LONG
56885 2000 //ID Altitude
56885 21 //ID MPH
I think I need to do 2 things;
-Go through the structure until I find the ID and then add the corresponding data to the structure
-If not found, create a new struct and add the ID.
Any help would be greatly appreciated
Many Thanks