Message-ID: <19991017144853.25231.rocketmail@web121.yahoomail.com> Date: Sun, 17 Oct 1999 07:48:53 -0700 (PDT) From: Mohamed Saad Subject: Re: exit() makes my program crash!!!! (The solution) To: djgpp AT delorie DOT com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Reply-To: djgpp AT delorie DOT com --- Eli Zaretskii wrote: > > On Thu, 14 Oct 1999, Mohamed Saad wrote: > > > i had a look > > on the source code of exit() and i found it sets > the > > mode back to text mode before calling _exit()! > > You didn't look deep enough under the hood. The > exit code calls the > `setmode' function to set the console device to the > text (as opposed to > binary) mode, but that has nothing to do with > switching the VGA to the > text mode. The text/binary mode of the console has > to do with > translation of CR-LF pairs into a single Newline > character during DOS > I/O, it has nothing to do with the VGA mode. > > > P.S. I have discovered that i do not free() some > > malloc'ed() memory! may this be the reason? > > No. All memory is released automatically when the > program exits. > > > P.P.S. before i forget, can i combine new, delete, > and > > realloc?? > > This is a very bad idea. In C++ programs you should > use new and > delete, not malloc and its friends. > Ummm... yeah! i misunderstood the purpose of the setmode() function! sorry! well... now my problem is over! thank you! :) Urs forever, Mohamed El Dawy P.S. er... so, how can i implement realloc() using C++?? ===== __________________________________________________ Do You Yahoo!? Bid and sell for free at http://auctions.yahoo.com