943,782 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 2321
  • C RSS
Feb 13th, 2008
0

miracle c problem

Expand Post »
I've never coded in c before but have to for a class that I'm taking. I'm using miracle c as my compiler but am having a strange error when I try to execute a program. The program executes, but the command window instantly closes so I can't even tell if the program is working as it should. This seems like it should be a fairly simple problem to solve, but is really annoying!

thanks,
nick clark
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
neclark2 is offline Offline
14 posts
since Feb 2008
Feb 13th, 2008
1

Re: miracle c problem

It's not an error. Windows automatically closes console applications once they're finished. To pause the program before it quits (so you can view the console output), put getchar(); at the end of your program.
Team Colleague
Reputation Points: 2240
Solved Threads: 338
Vampirical Lurker
John A is offline Offline
5,055 posts
since Apr 2006
Feb 13th, 2008
2

Re: miracle c problem

write getchar(); before return. That should pause until you press enter if no characters was left behind in the stdin.
If you can change compiler. Miracle C is broken. Look here for some suggestions
Aia
Reputation Points: 2224
Solved Threads: 218
Nearly a Posting Maven
Aia is offline Offline
2,304 posts
since Dec 2006
Feb 14th, 2008
-1

Re: miracle c problem

u can also getch() but it doesnot work in some compiler.
Reputation Points: 165
Solved Threads: 59
Posting Pro in Training
DangerDev is offline Offline
485 posts
since Jan 2008
Feb 15th, 2008
0

Re: miracle c problem

Click to Expand / Collapse  Quote originally posted by DangerDev ...
u can also getch() but it doesnot work in some compiler.
Why do people insist on making bad suggestions, especially after a good suggestion has been made?

And if you read the Rules, they request you use the word you, not the letter u, so people that don't speak English well can understand your post.
Moderator
Reputation Points: 3278
Solved Threads: 892
Posting Sage
WaltP is offline Offline
7,718 posts
since May 2006
Feb 15th, 2008
0

Re: miracle c problem

Click to Expand / Collapse  Quote originally posted by WaltP ...
Why do people insist on making bad suggestions, especially after a good suggestion has been made?

And if you read the Rules, they request you use the word you, not the letter u, so people that don't speak English well can understand your post.
thanx for suggestion
Reputation Points: 165
Solved Threads: 59
Posting Pro in Training
DangerDev is offline Offline
485 posts
since Jan 2008

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: character input through command line problem
Next Thread in C Forum Timeline: Get the Makefile.am from the Makefile





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


Follow us on Twitter


© 2011 DaniWeb® LLC