I have this loop in my program tha reads a phone number as a string:
while (loop) {
cout << "Telefone (0 para sair):" << endl;
string phone;
getline(cin, phone);
// .. some logic
while (loop2) {
// .. more logic
getline(cin, option);
// .. more logic
}
}
when the loop finishes the logic and returns to the begining, it doesn't ask for the phone again. It just goes through the logic again. Any ideas?
If I had used cin >> phone
instead, it doesn't catch phone numbers with blank spaces.