CathyLu CathyLu - 10 months ago 63
C Question

How to pause in C?

I am a beginner of C. I run the C program, but the window closes too fast before I can see anything. How can I pause the window?

Answer

you can put

getchar();

before the return from the main function. That will wait for a character input before exiting the program.

Alternatively you could run your program from a command line and the output would be visible.