Hi,
I was wondering if anyone could spot why my program 'misses out' my first question.
The program compiles, but when I run it, it immediately asks:
It isn't giving me chance to enter a name,.Name?
Address?
It instead jumps straight to the Address question.
Thanks for any help, I really appreciate it.Code:#include <iostream> #include <string> using namespace std; int main () { do{ int choice = 0; cout << "Choose one of the options below:" << endl; cout << "1) Enter a customer" << endl; cout << "2) Exit the program" << endl; cin >> choice; switch(choice) { case 1: { cout << "You chose to enter a lead" << endl; //--------------------- //Collect the details //--------------------- string mainname; cout << "Name? "; getline (cin, mainname); cout << "\n"; string mainaddress; cout << "Address? "; getline (cin, mainaddress); cout << "\n"; string mainpostcode; cout << "Post Code? "; getline (cin, mainpostcode); cout << "\n"; string maintelno; cout << "Telephone Number? "; getline (cin, maintelno); cout << "\n"; string maindetails; cout << "Details? "; getline (cin, maindetails); cout << "\n"; break; } case 2: { cout << "You chose to exit the program" << endl; break; } } } while(true); system ("PAUSE"); return 0; }