Mail Archives: djgpp/1999/10/17/10:15:39
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.
- Raw text -