On exit, app goes to Palm Prefs

Postby chuckbayes on Fri Oct 18, 2002 7:00 pm

Hello,

I am new to PocketC, and my C is a little rusty (like about 10 years!). I have created a simple guess the number game. I use gets() to ask for the low and high numbers, then generates a random number. The DO loop runs until the number is guessed correctly, then an alert() reports how many guesses it took. When the user presses "Ok", the next thing the user sees is the Palm Preferences! Is there a method for exiting cleanly that I should be using?

TIA,

Chuck
chuckbayes
 
Posts: 1
Joined: Fri Oct 18, 2002 6:52 pm
Location: USA

Postby Serge on Sat Oct 19, 2002 12:14 am

Yes.

At the end you have to write exit(); like this

main(){

//your codes

exit();

}// end main
Serge
 
Posts: 5
Joined: Fri Oct 18, 2002 9:17 pm
Location: Canada


Return to PocketC for Palm OS KB

Who is online

Users browsing this forum: No registered users and 1 guest

cron