A question about <stdlib.h>

I am practicing to write codes and checking their results on the console window these days. and the processor of the console window always hangs and it bothers me because I always have to kill them after I try a certain number of times to write codes. it just stays so many so visual studio says it can't make any more processor.

and now I just found why. it is because I always use
#include<stdlib.h>
at the top of my code and
system("pause")
at the end of the code.

it is necessary to check the result of the code with time, otherwise the console window disappears just right after it appears.

Question 1 : I have seen many people just write their code without system("pause") here, how do you guys check your result?
Question 2 : How can I not make anymore processor of console window except one?
See the second post in the thread that is stickied to the top of this forum:
http://www.cplusplus.com/forum/beginner/1988/
Question 1: The curious system("pause") hack does apply to MS-Windows only.
closed account (E0p9LyTq)
Question 1 : I have seen many people just write their code without system("pause") here, how do you guys check your result?


1. I let the IDE handle keeping the console window open, or

2. I manually open a console window before I execute the program.
Thank you guys, and sorry for being late : )

I just found that the solution better than system(something) and
it is bad from the link !
Last edited on
Topic archived. No new replies allowed.