Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8049605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:49:40+00:00 2026-06-05T06:49:40+00:00

I am having difficulty trying to understand what the following declaration means. Is this

  • 0

I am having difficulty trying to understand what the following declaration means. Is this declaration standard?

double* (*p[3]) (void* (*)());

Can anyone help me to understand the meaning of this declaration?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T06:49:41+00:00Added an answer on June 5, 2026 at 6:49 am

    Rule for reading hairy declarations: find the leftmost identifier and work outward, remembering that () and [] bind before *, so T *a[N] is an array of pointers to T, T (*a)[N] is a pointer to an array of T, T *f() is a function returning a pointer to T, and T (*f)() is a pointer to a function returning T. Since a function prototype may omit parameter names, you may see things like T *[N] or T (*)(). The meaning is mostly the same1, just pretend that there’s an identifier of 0 length.

    Thus,

              p                      -- p
              p[3]                   -- is a 3-element array
             *p[3]                   -- of pointers
            (*p[3]) (           )    -- to functions
            (*p[3]) (      (*)())    --   taking a pointer to a function
            (*p[3]) (    * (*)())    --   returning a pointer
            (*p[3]) (void* (*)())    --   to void
          * (*p[3]) (void* (*)())    -- returning a pointer
    double* (*p[3]) (void* (*)());   -- to double
    

    The important thing to take away here is that you are declaring p as an array of ..., not a function returning ....

    What would such a beast look like in practice? Well, first, you need three functions to point to. Each of these functions takes a single parameter, which is a pointer to a function returning a pointer to void:

    double *foo(void *(*)());
    double *bar(void *(*)());
    double *bletch(void *(*)());
    
    double *(*p[3]) (void *(*)()) = {foo, bar, bletch};
    

    Each of foo, bar, and bletch would call the function passed to it and somehow return a pointer to double.

    You would also want to define one or more functions that satisfy the parameter type for each of foo, bar, and bletch:

    void *blurga() {...}
    

    so if you called foo directly, you’d call it like

    double *pv;
    ...
    pv = foo(blurga);
    

    So we could imagine a call like

    double *pv = (*p[0])(blurga);
    

    1 – the difference is that in the context of a function parameter declaration, T a[] and T a[N] are identical to T *a; in all three cases, a is a pointer to T, not an array of T. Note that this is only true in a function parameter declaration. Thus, T *[] will be identical to T **.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to convert the following but am having difficulty. Can anyone see where I'm
I need help trying set-up Foreign Keys after having difficulty following Music library MySQL
Im having difficulty trying to design a database structure for the following scenario: My
I'm trying to use this library (which looks very nice) but I'm having difficulty
I am having difficulty trying to get modernizer to run with codeigniter. this is
I'm trying to understand some flash animation, and am having difficulty working out the
I am having difficulty making any sense of this! What is he trying to
I'm having difficulty trying to figure this out. I'm not even sure if it's
I am having a difficulty when trying to make an if-statement with $(this).attr(id) .
I have been trying to tackle this problem , but I am having difficulty

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.