Welcome to collectivesolver - Programming & Software Q&A. A website you can trust. I check, compile and run every program. Contact me at: aviboots(AT)netvision.net.il
Hostgator 1 Penny

BlueHost Web Hosting

Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

getflywheel wordpress hosting


Distribute your Resume to 500+ Job Boards & Recruiters


6,849 questions

9,751 answers

573 users

How to declare array and function pointers in C

Directory of Wholesale Companies and Dropship Suppliers | SaleHoo

22 views
asked Aug 15, 2017 by avibootz
edited Aug 16, 2017 by avibootz

1 Answer

0 votes
#include <stdio.h>

int main(void)
{
    int *p;              // int pointer (a pointer to an int)
    int **pp;            // a pointer to an int pointer (pointer to a pointer to an int)
    int (*pa)[];         // a pointer to an array of ints
    int (*pf)();         // a pointer to a function returning an int
    int *ap[3];          // an array of int pointers (array of pointer to 3 ints)
    int *fp();           // a function returning an int pointer
    int ***ppp;          // a pointer to a pointer to an int pointer
    int *aap[3][4];      // an array of arrays of int pointers
    int **app[3];        // an array of pointers to int pointers
    int (*apa[7])[7];    // an array of pointers to arrays of ints
    int (**ppa)[];       // a pointer to a pointer to an array of ints
    int (**ppf)();       // a pointer to a pointer to a function returning an int
    int *(*pap)[];       // a pointer to an array of int pointers
    int (*paa)[3][4];    // a pointer to an array of arrays of ints
    int *(*pfp)();       // a pointer to a function returning an int pointer
    int (*apf[3])();     // an array of pointers to functions returning an int
    int **fpp();         // a function returning a pointer to an int pointer
    int (*fpa())[];      // a function returning a pointer to an array of ints
    int (*fpf())();      // a function returning a pointer to a function returning an int
    
    return 0;
}


    
/*
run:

   
*/

 




answered Aug 15, 2017 by avibootz
...