Screen disappears immediately

Reply

Join Date: Aug 2008
Posts: 3
Reputation: blrjohn is an unknown quantity at this point 
Solved Threads: 0
blrjohn blrjohn is offline Offline
Newbie Poster

Screen disappears immediately

 
0
  #1
Aug 11th, 2008
Hello guys,

I m very much new on C. Need all of your help to improve. Right now I m getting one problem. I m writing the very basic program..

  1. #include <stdio.h>
  2.  
  3. int main() {
  4. printf("Hello World!\n");
  5. return 0;
  6. }

When I complie it is showing success. But when I Run this program its not showing me the dos screen properly. Just for a flash the dos screen coming and going off. Not getting the solution. Please help

John
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 2,030
Reputation: Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of 
Solved Threads: 176
Aia's Avatar
Aia Aia is offline Offline
Postaholic

Re: Screen disappears immediately

 
1
  #2
Aug 11th, 2008
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. printf("Hello World!\n");
  5. getchar(); /* waits until user enters a key if the standard input buffer doesn't contain any */
  6. return 0;
  7. }
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 3
Reputation: blrjohn is an unknown quantity at this point 
Solved Threads: 0
blrjohn blrjohn is offline Offline
Newbie Poster

Re: Screen disappears immediately

 
0
  #3
Aug 11th, 2008
Ammazing. Its working Now. Many thanks Aia.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 1,602
Reputation: jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of 
Solved Threads: 120
jephthah's Avatar
jephthah jephthah is offline Offline
Posting Virtuoso

Re: Screen disappears immediately

 
0
  #4
Aug 12th, 2008
simply.

amazing.

Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 374
Reputation: Clockowl is on a distinguished road 
Solved Threads: 27
Clockowl's Avatar
Clockowl Clockowl is offline Offline
Posting Whiz

Re: Screen disappears immediately

 
1
  #5
Aug 12th, 2008
By the way blrjohn, you could also try and fire up a console and execute your program from there. It won't disappear then. I dunno on which OS you are, but guessing it's Windows (80% market share or something eh):

Go to:

Start -> Run

type in "cmd"

Hit enter.

Behold the almighty black screen with often blinking cursor!

Typing in "cd" and then a path will let you change your directory. Type in "help" if you're in need of more help. Mastering the console is pretty convenient for developers.
Last edited by Clockowl; Aug 12th, 2008 at 7:11 pm.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 13
Reputation: gautam610 has a little shameless behaviour in the past 
Solved Threads: 3
gautam610 gautam610 is offline Offline
Newbie Poster

Re: Screen disappears immediately

 
-1
  #6
Aug 13th, 2008
u can see ur result by pressing ctrl+f5 or u can see ur result by adding a simple "getch();"
in ur code...........................
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 2,030
Reputation: Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of Aia has much to be proud of 
Solved Threads: 176
Aia's Avatar
Aia Aia is offline Offline
Postaholic

Re: Screen disappears immediately

 
1
  #7
Aug 13th, 2008
Originally Posted by gautam610 View Post
u can see ur result by pressing ctrl+f5 or u can see ur result by adding a simple "getch();"
in ur code...........................
Do you think every one in the world uses the same copiler/IDE that you use?
Your suggestions are not an improvement upon what it has been discussed already.

Welcome to the forum.
Avoid chat rooms speaking format next time you post. We can afford full words in English. There's not restriction about saving bits over here.
Last edited by Aia; Aug 13th, 2008 at 1:58 am.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC