delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/22/18:50:57

Sender: nate AT cartsys DOT com
Message-ID: <36CF6F3B.D6396260@cartsys.com>
Date: Sat, 20 Feb 1999 18:28:11 -0800
From: Nate Eldredge <nate AT cartsys DOT com>
X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.2.1 i586)
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: Duh
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>
Reply-To: djgpp AT delorie DOT com

Bjørn Hansen wrote:

> Michael Stefan wrote:
> 
> > You tried to use the "\n" (newline) command from C instead of endl. It
> > should look like this
> > #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?

Hee hee... Excellent.  That's a bug and a very common one.  It should,
by all standards, be `int main'.
-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019