Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #19346

Re: Function prototype inside function prototyp

From Sam Hu <samhu.samhu@gmail.com>
Newsgroups comp.lang.c
Subject Re: Function prototype inside function prototyp
Date 2012-04-04 18:13 -0700
Organization http://groups.google.com
Message-ID <16466028.531.1333588392644.JavaMail.geo-discussion-forums@vbab2> (permalink)
References <2f93aa41-3f37-4670-9515-7a44f0eeb9ec@wb9g2000pbc.googlegroups.com> <87wr5xvpr6.fsf@blp.benpfaff.org>

Show all headers | View raw


On Tuesday, April 3, 2012 4:32:29 AM UTC+8, Ben Pfaff wrote:
> Sam Hu <samhu.samhu@gmail.com> writes:
> 
> > I've never seen this until now:
> >
> > void thisworks(char c,int put(char ch,void* cl),void* cl)
> > {
> >       printf("This works!\n");
> > }
> >
> > Why the function prototye int put(char ch,void* cl) can be in another
> > function declaration void thisworks(....) and where can I get more
> > information regarding this usage?
> 
> C99 says this:
> 
>      6.7.5.3  Function declarators (including prototypes)
> ...
> 
> 8    A declaration of a parameter as ``function returning type''
>      shall be adjusted to ``pointer to function returning type'',
>      as in 6.3.2.1.
> 
> C89 said something similar, and I imagine that C11 does too.
> -- 
> Ben Pfaff 
> http://benpfaff.org

Thank you so much.It is clear now.

Back to comp.lang.c | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Function prototype inside function prototyp Sam Hu <samhu.samhu@gmail.com> - 2012-03-27 21:28 -0700
  Re: Function prototype inside function prototyp nick_keighley_nospam@hotmail.com - 2012-03-29 00:38 -0700
  Re: Function prototype inside function prototyp Ben Pfaff <blp@cs.stanford.edu> - 2012-04-02 13:32 -0700
    Re: Function prototype inside function prototyp Sam Hu <samhu.samhu@gmail.com> - 2012-04-04 18:13 -0700

csiph-web