Re: strange case of void main
From: Enrico `Trippo' Porreca (trippo_at_lombardiacom.it)
Date: 04/22/04
- Next message: Stephen Sprunk: "Re: Rob Pike's simple Include rule"
- Previous message: Rakesh Kumar: "Re: strange case of void main"
- In reply to: Ziggy: "strange case of void main"
- Next in thread: Régis Troadec: "Re: strange case of void main"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 22 Apr 2004 23:44:02 +0200
Ziggy wrote:
> Just for curiosity.
> I know that main function is returning
> an int, but I came cross with the following
> code. (Unnessecary code is snipped) Is there
> any problem with it?
>
> #include <stdlib.h>
> void main(){
> exit(EXIT_SUCCESS);
> }
Yes: main *must* be declared as an int-returning function, even if you
call exit to terminate your program.
- Next message: Stephen Sprunk: "Re: Rob Pike's simple Include rule"
- Previous message: Rakesh Kumar: "Re: strange case of void main"
- In reply to: Ziggy: "strange case of void main"
- Next in thread: Régis Troadec: "Re: strange case of void main"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|