Hi programer

sam_mcgowan's Avatar, Join Date: Sep 2006
Newbie Member
Hi I am new to both programing and the forum, I wish this one to be very learning experience for me.
Cheers!
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Yes sure you will have. Welcome to G4EF.
0
sam_mcgowan's Avatar, Join Date: Sep 2006
Newbie Member
Hi Shabbir thanks for the welcome.
I have VERY basic question. I have just started learning c++. My problem is when I comile and run my first program (just to print " Hello World"). The the result window disappears in a fraction of a second and I can not view the result. I use Dev-C++ free compiler. Is there any way I can see the result window for a longer time.
Thanks for looking at very basic question.
I hope to get some solution and try running more programs over this labor day weekend.
-Sam_mcgowan
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Try using getch() function before the return statement of the main function and you should see the window not disappear until you press any key. getch() is defined in conio.h file and so may need to include the header file as well.
0
sam_mcgowan's Avatar, Join Date: Sep 2006
Newbie Member
Thanks! amazingly it worked! This will help me ramp up building new programs and running them.
Just now I also found another way in the software FAQ: use of- system ("pause"); along with inclusion of stdlib.h.
Maybe there are several other avenues to pursue one thing!
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Yes thats true. pause is a system command and may not work on any other OS apart from DOS.