Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Missing prototype?

95 views
Skip to first unread message

Bartc

unread,
Feb 2, 2008, 6:39:54 AM2/2/08
to
Please tell me what's wrong with the following code. Keeps saying missing
prototype for test().

Thanks,
Bart


void test();

int main(void)
{
test();
}

test()
{
}


Bartc

unread,
Feb 2, 2008, 6:55:51 AM2/2/08
to

> Please tell me what's wrong with the following code. Keeps saying missing
> prototype for test().

> void test();
>
> int main(void)
> {
> test();
> }
>
> test() /* yes this was void test() once */
> {
> }

Seems like it doesn't like functions not having empty params. Using (void)
fixes it.

BTW that test() definition /was/ void test() at one point, but it still had
the problem. I tried lots of combinations!

Bart


jacob navia

unread,
Feb 2, 2008, 7:05:28 AM2/2/08
to

Note:

int foo(); // Function with an INDETERMINATE number of args
int foo(void); // Function with NO args.

You see?

There IS a big difference.

--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32

0 new messages