home *** CD-ROM | disk | FTP | other *** search
- Path: comma.rhein.de!yaps!arno
- From: arno@yaps.rhein.de (Arno Eigenwillig)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: C compiler problem
- Message-ID: <JAx1y*HHf@yaps.rhein.de>
- Date: Fri, 02 Feb 1996 18:30:05 +0100
- References: <4ek3b2$a5k@nntp.novia.net> <3005pbd60.alamito@marketgraph.xs4all.nl>
- Organization: Yet Another Private Site in Meckenheim, Germany
- X-Copyright: This article may not be distributed on a CD-ROM
- or in printed form without prior written consent of the author.
- X-Newsreader: Arn V 1.04
-
- In article <3005pbd60.alamito@marketgraph.xs4all.nl>, Ruud van Gaal writes:
-
- > >int main();
- >
- > Can be left out.
-
- Yes.
-
- > >int main()
- >
- > void main(void) is better prototyped in C. C++ might use void main()
-
- Doubly wrong!
-
- - This is a function definition, not a prototype. If you declare no
- parameters in a function definition (just use "()"), the function
- takes none. This is not to be confused with a prototype context,
- in which an empty parameter list means that nothing is said about
- which parameters the function takes.
- The meaning of a parameter list consisting of "void" is equivalent
- for both cases.
-
- - By ISO 9899, The ANSI/ISO C Standard, the only two permissible forms
- for main() for a strictly conforming program are:
- int main(void)
- int main(int, char**)
- Everything else results in undefined behaviour, which is in this
- case relatively benign under AmigaOS: usually a nonsentical return
- code. This is rather annoying, though, if the program is invoked
- from a shell.
-
- C++ is different.
-
- -- __
- __/// Arno Eigenwillig /\ <arno@yaps.rhein.de> \/ PGP key available.
- \XX/ V+49-2225-5870 /\ <Arnooo @ #amigager> \/ MIME 8bit welcome.
-