It seems that I can't find any solution to this problem, so I'm asking you. C doesn't support iostream and Console.Readkey unless i did something wrong, so please help!
Asked
Active
Viewed 43 times
0
-
Why would you like to do this? The wast majority of console programs _shall_ exit without an additional user input. And never ever insist of keyboard input. – the busybee May 07 '22 at 09:35
2 Answers
2
C
getc(stdin);
C++
std::cin.get();
Worst Example Listed on Many Websites
system("pause"); //never use this
Darth-CodeX
- 1,851
- 4
- 19
0
You can use getchar() or getc(stdin) to read a character. The console is line buffered by default (at least on Linux) so it means it will wait for enter.
Allan Wind
- 11,844
- 4
- 24
- 32