I'm trying to read a string until a ',' character is reached and store what's been read in a new string.
e.g. "5,6"
// Initialise variables.
string coorPair, xCoor, yCoor
// Ask to enter coordinates.
cout << "Input coordinates: ";
// Store coordinates.
cin >> coorPair
// Break coordinates into x and y variables and convert to integers.
// ?
I also need to store the y value in a separate variable.
What is the best way to do this in C++?
Also, is the best way to validate the input to convert to integers and test the values range?