ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/09/02:45:49

Message-Id: <3.0.16.19971209084004.23f72fec@hem1.passagen.se>
Date: Tue, 09 Dec 1997 08:42:36 -0500
To: iwaki AT gte DOT net
From: Peter Palotas <blizzar AT hem1 DOT passagen DOT se>
Subject: Re: why do i get this compiler error?
Cc: djgpp AT delorie DOT com
Mime-Version: 1.0

At 04.34 1997-12-08 GMT, you wrote:
>I don't know much about C/C++.  I starting to learn.  This may sound
>real silly but could it be that the '{' after the int(main) shouldn't be
>on same line?
>
>You have:
>
>int main()   {
>
>
>Should'nt it be:
>
>int main()
>{  ...
>   ...
>}
>
>I really don't know about any other errors.  Perhaps other users could
>suggest something.

This is NOT an error. It's perfectly legal in C/C++ to put the '{' on the
same line as 'int main(void)'.  C is not a line oriented language.  I think
the GNU programming standard actually uses this way of writing code.


-- Peter Palotas alias Blizzar -- blizzar AT hem1 DOT passagen DOT se --

*****************************************************
* A brief description of DJGPP:                     *
* NEVER BEFORE HAS SO FEW DONE SO MUCH FOR SO MANY! *
*****************************************************

- Raw text -


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