From 5164738811439168227
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,18ca6bab598a1e70
X-Google-Attributes: gidf78e5,public
From: comeau@panix.com (Greg Comeau)
Subject: Re: Does "main()" always return an int    ! T V Y a c f g j x
Date: 1998/01/19
Message-ID: <69ui49$5qr@panix.com>#1/1
X-Deja-AN: 317520959
References: <01bd23be$33c440e0$480b48a6@aptiva>
X-Original-Date: 18 Jan 1998 22:43:05 -0500
Reply-To: comeau@comeaucomputing.com
Originator: austern@isolde.mti.sgi.com
X-Newsposter: trn 4.0-test55 (26 Feb 97)
Organization: Comeau Computing; http://www.comeaucomputing.com
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBVAwUANMP5Pky4NqrwXLNJAQFpfwH9EDB77LjeVCsRMncUFGi5EOdqqkZ2sLOr 1nBgyARKdrvLCBAJ2RQU3ZEyDd+1kD5VGjPp3TNZ38odaOKUUIr88Q== =pK9U
Newsgroups: comp.std.c++


In article <01bd23be$33c440e0$480b48a6@aptiva> "Don R. O'Brien" <drobri@ibm.net> writes:
>I have a question for the group.  Does "main()" always return an int ?  In
>Microsoft Visual C++ "main()" is allowed to return void.  Some books on C++
>programming also use the "void main()" function definition.  Solaris C++
>and Borland C++ 5.0 seem only to mention the "int main()" function
>definition.  The ARM book also only mentions the "int main()" function
>definition.
>
>So what does the new C++ standard say?  How is "main()" defined ?

Many compilers will allow other return types, most namely void,
but main() is supposed to return int.

- Greg
-- 
       Comeau Computing, 91-34 120th Street, Richmond Hill, NY, 11418-3214
               Producers of Comeau C++ 4.0 front-end pre-release
****WEB: http://www.comeaucomputing.com / Voice:718-945-0009 / Fax:718-441-2310
 Here:comeau@comeaucomputing.com / BIX:comeau or comeau@bix.com / CIS:72331,3421
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu 
]



