home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!att-out!rutgers!sun-barr!ames!agate!doc.ic.ac.uk!uknet!mcsun!sunic!kth.se!news.kth.se!d90-awe
- From: d90-awe@tukur.nada.kth.se (Assar Westerlund)
- Newsgroups: comp.lang.c
- Subject: Re: Is this ANSI C?
- Message-ID: <D90-AWE.92Nov8200025@tukur.nada.kth.se>
- Date: 8 Nov 92 19:00:25 GMT
- References: <1dhkrtINNj99@duvel.cs.ubc.ca>
- Sender: usenet@kth.se (Usenet)
- Organization: Royal Institute of Technology, Stockholm, Sweden
- Lines: 25
- In-Reply-To: hassan@cs.ubc.ca's message of 7 Nov 1992 15:52:29 -0800
- Nntp-Posting-Host: tukur.nada.kth.se
-
- In article <1dhkrtINNj99@duvel.cs.ubc.ca> hassan@cs.ubc.ca (Moustafa Hassan) writes:
-
- #include <stdio.h>
- void main(void)
- {
- printf("hello world\n");
- }
-
- To settle a dispute, would someone please tell me whether the above
- is ANSI C. I claim that 'main' (according to the pure ANSI standard)
- must return an integer value, but nonetheless, some non-purists claim
- that the above is ANSI. Please do not respond via email; I want
- my opponent (8^) to be able to see all the messages.
-
- According to the ISO standard, equivalent to ANSI C:
-
- 5.1.2.2.1 Program startup
-
- [ ... ]
-
- It can be defined with no parameters:
-
- int main(void) { /* ... */ }
-
- or with two parameters [ ... ]
-