| delorie.com/archives/browse.cgi | search |
| From: | Dave Bird <dave AT xemu DOT demon DOT co DOT uk> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: Duh |
| Date: | Sun, 21 Feb 1999 02:15:16 +0000 |
| Organization: | very little |
| Message-ID: | <XBmHFYA0w2z2Ewbc@xemu.demon.co.uk> |
| References: | <36CCA146 DOT 8BCD8720 AT mail DOT globalserve DOT net> |
| <7alvgv$25g$1 AT news7 DOT svr DOT pol DOT co DOT uk> <36CEADC5 DOT 7422E668 AT xyz DOT net> | |
| NNTP-Posting-Host: | xemu.demon.co.uk |
| X-NNTP-Posting-Host: | xemu.demon.co.uk:158.152.196.209 |
| X-Trace: | news.demon.co.uk 919606501 nnrp-07:13676 NO-IDENT xemu.demon.co.uk:158.152.196.209 |
| X-Complaints-To: | abuse AT demon DOT net |
| MIME-Version: | 1.0 |
| X-Newsreader: | Turnpike (32) Version 4.01 <dQumtnY$x4rJ2u5tL5fS$n2vuP> |
| Lines: | 20 |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
In ar<36CEADC5 DOT 7422E668 AT xyz DOT net>, Bjørn Hansen <viking AT xyz DOT net> writes
>> #include <iostream.h>
>>
>> void main()
>> {
>> cout<<"Hello world"<endl;
>> return 0;
>> }
>
>I havn't done a whole bunch of progremming in C++ so I was wondering why you
>declared main as void and then have it return a value?
Whoops -- because he goofed. Having void main(), or sometimes having
int main(){ ..... return n; } are both acceptable.
Have a void function return a value isn't!
--
Dave[XEMU] ________________(....=^¬¬^=______ ---<,,">
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |