help regarding syntax... - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

help regarding syntax...

rishabhohririshabhohri Posts: 8Member
I would like to know some very trivial tings that i really dont know i will be very thankful if someone helps me out with these:

1)void *(*func)(void *) // What does this syntax mean?
2)void *blah( void *arg) // And this one too what does this mean?

Comments

  • LundinLundin Posts: 3,711Member
    void *blah( void *arg)

    could more properly be written as

    void* blah (void* arg)

    It is a function that takes a void pointer as parameter, and returns a void pointer as result.

    void *(*func)(void *)

    This is a function pointer, a pointer that can point to a function taking a void pointer as parameter, and returning a void pointer as result. Yes, the syntax is quite horrible and hard to learn. I'd suggest reading up on function pointers, I'm not sure I can explain them in a pedagogical way.
Sign In or Register to comment.