This works, it pauses my program as desired:
This code displays the cout statements and goes back to the main loop:Code:std::cout << "\n [S]ave Report [O]pen Report"; std::cout << "\n [Q]uit" << std::endl; std::cout << "\n Enter Choice: "; std::cin >> choice; switch(choice) { case 'i': system ("clear"); one.ClearIt(); std::cout << "\n Program has been set to defaults."; std::cout <<"\n Press [Enter] to continue."; std::cin.get(); std::cin.get(); break; default: break;
Press [Enter] to continue is straight out of the programming faq, I compiled the example without fail, with only 1 cin.get() statement, My question is: why does the example work, when I put it into my program, it just skipped over it, how?Code:std::cout << "\n [S]ave Report [O]pen Report"; std::cout << "\n [Q]uit" << std::endl; std::cout << "\n Enter Choice: "; std::cin >> choice; switch(choice) { case 'i': system ("clear"); one.ClearIt(); std::cout << "\n Program has been set to defaults."; std::cout <<"\n Press [Enter] to continue."; std::cin.get(); break; default: break;



LinkBack URL
About LinkBacks


