Mail Archives: djgpp/1999/10/17/12:34:32
--- Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> 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
- Raw text -