I have installed TDM-GCC compiler on my system. And I write my c programs in a text editor and save it with the .c extension and compile it using the gcc command in the MinGW terminal and as usual the a.exe file is created as a result of it but when I double click the a.exe file and open it a terminal appears displaying the output and this terminal closes as soon as the program execution is over.... How do I stop this terminal from closing as soon as the program is over??
Asked
Active
Viewed 29 times
0
-
Put `system("PAUSE");` or `getchar();` or something like that at last. – BLUEPIXY Sep 16 '17 at 16:49
-
2do not double click; run cmd.exe instead, then type a.exe – DaBler Sep 16 '17 at 16:50
-
hasn't this been answered like 32430 times? – Antti Haapala -- Слава Україні Sep 16 '17 at 17:23