From: "Damian Yerrick" Newsgroups: comp.os.msdos.djgpp References: <19991016090802 DOT 4896 DOT rocketmail AT web115 DOT yahoomail DOT com> Subject: Re: exit() makes my program crash!!!! (FINAL comment) Lines: 25 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Message-ID: <6dpP3.429$zO.16544@dfiatx1-snr1.gtei.net> X-Trace: /Kw5eG17XvVPnz02SNeyOhNJKeK4lsb0nVrSpMV7I8uE6c7ycoxkaZkiAisB8nLM2ty5qK4tNPLL!rQQMqFfYI3p0U5bfCM+uYw0UGfaQmR1tFt34hCE23EiNWqEi3kvzdm0kXD542tCO/VHjOQ== X-Complaints-To: abuse AT gte DOT net X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly NNTP-Posting-Date: Wed, 20 Oct 1999 20:02:10 GMT Distribution: world Date: Wed, 20 Oct 1999 20:02:10 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Mohamed Saad wrote: > > i have discovered that the program does NOT freeze! > the program has actually finished! but screen did not > return to text mode!! i became sure of this, as, after > the program freezed, i just typed 'exit' and i simply > returned back to windows! > This simply means that exit() does NOT always return > back to text mode by itself! i HAVE to put the > following line: > screen.settext(); > before ANY call to exit!! Or just put this in your atexit() handler. exit() always calls all installed atexit() handlers. Check the libc docs for more info. -- Damian Yerrick CM 398, Rose-Hulman Institute of Technology 5500 Wabash Ave Terre Haute, IN 47803 http://come.to/yerrick