• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: no previous prototype for function that is defined in header?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: no previous prototype for function that is defined in header?
      • From: "Clark S. Cox III" <email@hidden>
    • Re: no previous prototype for function that is defined in header?
      • From: Marc Respass <email@hidden>
    • Re: no previous prototype for function that is defined in header?
      • From: Sherm Pendley <email@hidden>
References: 
 >no previous prototype for function that is defined in header? (From: Marc Respass <email@hidden>)
 >Re: no previous prototype for function that is defined in header? (From: Marc Respass <email@hidden>)

  • Prev by Date: Re: Recursive blocks
  • Next by Date: Re: no previous prototype for function that is defined in header?
  • Previous by thread: Re: no previous prototype for function that is defined in header?
  • Next by thread: Re: no previous prototype for function that is defined in header?
  • Index(es):
    • Date
    • Thread