Examples Of C Declarations

This file will be a handout early in the quarter

int i;
int *p;
int a[];
int f();
int **pp;
int (*pa)[];
int (*pf)();
int *ap[];
int aa[][];
int af[]();
int *fp();
int fa()[];
int ff()();
int ***ppp;
int (**ppa)[];
int (**ppf)();
int *(*pap)[];
int (*paa)[][];
int (*paf)[]();
int *(*pfp)();
int (*pfa)()[];
int (*pff)()();
int **app[];
int (*apa[])[];
int (*apf[])();
int *aap[][];
int aaa[][][];
int aaf[][]();
int *afp[]();
int afa[]()[];
int aff[]()();
int **fpp();
int (*fpa())[];
int (*fpf())();
int *fap()[];
int faa()[][];
int faf()[]();
int *ffp()();

an int
an int pointer
an array of ints
a function returning an int
a pointer to an int pointer
a pointer to an array of ints
a pointer to a function returning an int
an array of int pointers
an array of arrays of ints
an array of functions returning an int (ILLEGAL)
a function returning an int pointer
a function returning an array of ints (ILLEGAL)
a function returning a function returning an int (ILLEGAL)
a pointer to a pointer to an int pointer
a pointer to a pointer to an array of ints
a pointer to a pointer to a function returning an int
a pointer to an array of int pointers
a pointer to an array of arrays of ints
a pointer to a an array of functions returning an int (ILLEGAL)
a pointer to a function returning an int pointer
a pointer to a function returning an array of ints (ILLEGAL)
a pointer to a function returning a function returning an int (ILLEGAL)
an array of pointers to int pointers
an array of pointers to arrays of ints
an array of pointers to functions returning an int
an array of arrays of int pointers
an array of arrays of arrays of ints
an array of arrays of functions returning an int (ILLEGAL)
an array of functions returning int pointers (ILLEGAL)
an array of functions returning an array of ints (ILLEGAL)
an array of functions returning functions returning an int (ILLEGAL)
a function returning a pointer to an int pointer
a function returning a pointer to an array of ints
a function returning a pointer to a function returning an int
a function returning an array of int pointers (ILLEGAL)
a function returning an array of arrays of ints (ILLEGAL)
a function returning an array of functions returning an int (ILLEGAL)
a function returning a function returning an int pointer (ILLEGAL)