943,546 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 1214
  • C RSS
Aug 11th, 2008
0

Screen disappears immediately

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
blrjohn is offline Offline
3 posts
since Aug 2008
Aug 11th, 2008
1

Re: Screen disappears immediately

  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. }
Aia
Reputation Points: 2224
Solved Threads: 218
Nearly a Posting Maven
Aia is offline Offline
2,304 posts
since Dec 2006
Aug 11th, 2008
0

Re: Screen disappears immediately

Ammazing. Its working Now. Many thanks Aia.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
blrjohn is offline Offline
3 posts
since Aug 2008
Aug 12th, 2008
0

Re: Screen disappears immediately

simply.

amazing.

Reputation Points: 2143
Solved Threads: 178
Posting Maven
jephthah is offline Offline
2,567 posts
since Feb 2008
Aug 12th, 2008
1

Re: Screen disappears immediately

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.
Reputation Points: 69
Solved Threads: 28
Posting Whiz
Clockowl is offline Offline
376 posts
since May 2008
Aug 13th, 2008
-1

Re: Screen disappears immediately

u can see ur result by pressing ctrl+f5 or u can see ur result by adding a simple "getch();"
in ur code...........................
Reputation Points: 5
Solved Threads: 3
Newbie Poster
gautam610 is offline Offline
13 posts
since Jul 2008
Aug 13th, 2008
1

Re: Screen disappears immediately

Click to Expand / Collapse  Quote originally posted by gautam610 ...
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.
Aia
Reputation Points: 2224
Solved Threads: 218
Nearly a Posting Maven
Aia is offline Offline
2,304 posts
since Dec 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: solving linear equation in turbo c
Next Thread in C Forum Timeline: extract max-min value from every column in array





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC