What is a 'nice' standard way of holding the console open in C? I'm looking for something similar to cin.clear(), cin.get();
in C++.
puts("Press <enter> to quit:");
getchar();
That's assuming you need to do this in the program, which is probably not a good idea in general. And if I run your program from a shell, I'm going to be a bit annoyed at the extra step when I'm expecting the program to terminate nicely and let me have my next prompt.
I use the below 2 lines of code.
printf("Press ENTER key to Continue\n");
getchar();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With