Which C compiler are you using?I'm programming in C language.
I use printf function and when I run the program, I cannot see what it prints.
What would be a proper way to hold the program at a desired point?
dev-c++ compiler debugging
#include <stdio.h>
int main()
{
printf ("Press ENTER to continue.\n");
getchar (); // wait for input
return 0;
}
#include <stdlib.h>
int main()
{
system ("pause"); // execute M$-DOS' pause command
return 0;
}
Maybe, but as I understand it. The OP is running the program from the compiler enviroment just to learn C. Then this method will work more than good.That is not a good solution as it is dependant on some rather old code, better way is to start the command line and run the program from there instead of double clicking on it.
Also the approach with pause won't help you when you have some console program like gcc which just blinks and dissapears, and you want to see result. Then command line is your only option as you can't change the program you are running.