In my lab I'm trying to process a line that represents a destination on Earth. An example of this is ....
"152/N 200/E California Ave"
In my professor's notes, he said that if you did this ...
std::cin >> latitude >> latitudeDirection >> longitude >> longitudeDirection >> address
Which consumes all the way up until California, where from there on out the string is consumed one at a time at each white space. How do I make it so I consume the rest of the input? Here's how my variables look when assigned ...
latitude = 152
latitudeDirection = "/N"
longitude = 200
longitudeDirection = "/E"
address = "California"
address only holds "California" when I want it to hold "California Ave". Here's the code I have so far.
int numberOfLocations;
std::cin >> numberOfLocations;
std::cin.ignore();
for (int x = 0; x < numberOfLocations; x++) {
double longitude, latitude;
std::string longitudeDirection, latitudeDirection, address;
/*
std::cin >> latitude >> latitudeDirection >> longitude >> longitudeDirection >> address;
std::cout << latitude << latitudeDirection << latitude << latitudeDirection << address << std::endl;
*/
}