*-Hamish Moffatt <[EMAIL PROTECTED]>
|
| On Sat, Nov 28, 1998 at 09:03:39AM +0100, Ole J. Tetlie wrote:
| > It can also be 'int main(void)', which is equivalent to 'main()'.
| 
| Hmmm. I was told that 'int func(void)' means it takes no parameters,
| while 'int func()' means it could take any.

That is correct, unless the declaration is also part of a definition.

int func();

does not specify anything about arguments (and as Matthew said, this
will hopefully and probably go away in the next revision), but

int func()
{
        /* do something */
}

specifies that func takes no argument.

| Some example source is below. gcc complains about the call to test2
| (too many arguments) but not to test1.

IMNSHO, gcc should have complained on both.

-- 
The only way tcsh "rocks" is when the rocks are attached to its feet
in the deepest part of a very deep lake.             (Linus Torvalds)
[EMAIL PROTECTED]   [-: .elOle. :-]   [EMAIL PROTECTED]

Reply via email to