Question:
Help, C++ program, Implement "Press any key to continue"?
sogsos14
2010-10-20 18:13:12 UTC
I'm building a program in C++ for a class that converts gallons to liters. I already have the program written but i need to implement "Press any key to continue". I did it but when you enter the number of gallons and hit enter it terminates the program. I need a way to make it ignore the first time you hit enter (entering the number of gallons) and display "Press any key to continue" after it does the math.
Four answers:
I AM A STAR
2010-10-20 19:13:55 UTC
system("PAUSE");

return 0;
The Phlebob
2010-10-21 02:41:01 UTC
Put the output of "Press any key to continue" and a subsequent input of any keypress (getchar() would work in C) right before the return 0; statement.



Hope that helps.
tbshmkr
2010-10-21 01:21:29 UTC
Show our code.

=

We can then help you make it work right.
anonymous
2010-10-21 01:25:47 UTC
system("Press any key to continue");


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...