all groups > visual c libraries > december 2004 >
You're in the

visual c libraries

group:

static main


static main C G S Reddy
12/30/2004 3:51:03 AM
visual c libraries: what happens if we declare main(.. as below in c language?

static void main()
{
..
..
Re: static main Doug Harrison [MVP]
12/30/2004 10:24:35 AM
[quoted text, click to view]

I don't know about C, but in C++, it makes the program ill-formed. VC 7.1
seems to ignore the "static", not to mention the void return type, which is
also illegal. So, this seems to be a case of:

Patient: Doc, it doesn't hurt when I do this.
Doc: Well, don't do it anyway!

--
Doug Harrison
AddThis Social Bookmark Button