Re: [Hampshire] C dialects

Top Page

Reply to this message
Author: Chris Liddell
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] C dialects
At 13:19 09/07/2007 +0100, you wrote:

><SNIP>
>For instance Dev is happy with
>
>main()
>{
>code
>}
>
>but gcc won't have that, it insists on
>
>main (void)
>{
>code
>}
>
>A small difference - but most irritating if you're very new to C as I am.


Both are /wrong/!

The main() function is:

int main (int argc, char **argv)

or

int main (int argc, char *argv[])


If you're new to C, it would be best to get into good habits from the start!

Chris



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.476 / Virus Database: 269.10.2/891 - Release Date: 08/07/2007 18:32