Re: no previous prototype for function that is defined in header?
Re: no previous prototype for function that is defined in header?
- Subject: Re: no previous prototype for function that is defined in header?
- From: Mark Wagner <email@hidden>
- Date: Fri, 28 Jan 2011 14:13:38 -0800
On Tue, Jan 25, 2011 at 14:17, Marc Respass <email@hidden> wrote:
> While I was responding, I was trying various things. I changed my function from foo() to foo(void) and that fixed it. I feel like such a schmuck. I even have my K & R book out but didn't find the answer. Maybe years of Java have replaced my C knowledge but I didn't realize that I had to have "void" in a method that takes no arguments. I checked the C Language Dialect and it's set to GNU99.
>
In standard C, foo() is a function that takes an arbitrary number of
parameters. foo(void) is a function that takes zero parameters. The
distinction is usually academic, but there is the occasional case
where it matters.
C++ changes this: foo() and foo(void) are both functions that take
zero parameters.
I don't know how Objective-C and Objective-C++ handle things.
--
Mark
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden