Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.