Keep cmd open when running file
6 answers
Yes, the general solution is to add an instruction that reads keyboard input. This call blocks execution until any key is pressed. You can do it with statements like
printf("Hit \"Enter\" to continue\n");
fflush(stdin); /* Remove anything that is currently in the standard input */
getchar(); /* Wait for the user to hit the enter key */
+1
source to share