Mail Archives: djgpp/1998/01/23/22:02:41
On Fri, 23 Jan 1998 19:14:46 -0300 in comp.os.msdos.djgpp Alejandro
Martin Sanchez <alesan AT iname DOT com> wrote:
: void main(void)
: {
: char *foo;
: foo = new char [2000000L];
: if (foo == NULL)
: {
: printf("Error: I can not allocate 2Mb\n");
: return;
: }
: delete foo;
: }
`new' and `delete' are C++ keywords. In C++ programs, the `main'
function *must* return an int. If you compile with -Wall the compiler
will inform you of this, and tell you that it's changing the return
type to `int'. If you don't use -Wall then the compiler will do it
anyway, but it just won't tell you about it.
--
george DOT foot AT merton DOT oxford DOT ac DOT uk
- Raw text -