Basically I want to be able to ask the user to enter a grid reference which is two letters followed by 6 numbers eg SX 345787 and then put that into an array. Is this possible?
std::string line;
std::getline(line, cin); // Gets everything up to a \n (enter).
// line now contains "SX 345787"
std::stringstream iss(line); // Let's put this in a stream.
struct Grid_reference // Let's decide how we will store/access this data
{
std::string LetterPart;
int NumberPart;
} grid_reference;
iss >> grid_reference.LetterPart; // Let's extract the data from the stream and put it in the structure.
iss >> grid_reference.NumberPart; // And we can continue with the numbers.