These are some declarations and notations in the C language. These are summarized in the following table:
Declarations | p is a | that takes | and returns |
---|---|---|---|
int *p; | pointer to an integer | a pointer | an integer |
int *p[10]; | p is a 10 element array of pointer to integer | 10 element array of pointer | an integer |
int (*p)[10]; | p is a pointer to a 10-element integer array | a pointer | integer array |
int *p(); | p is a function that returns a pointer to an integer | function | a pointer to an integer |
int p(char *a); | p is a function | an argument as pointer to a character | an integer |
int *(char *a); | p is a function | an argument as pointer to a character | a pointer to an integer |
int (*p) (char *a); | p is a pointer to a function | an argument as pointer to a character | an integer |
int (*p (char *a)) [10]; | p is a function | an argument as pointer to a character | a pointer to a 10 element integer array |
int p(char (*a) []); | p is a function | as argument as pointer to a character array | an integer |
int p(char *a []); | p is a function | an argument as array of pointers to a characters | an integer |
int *p(char a []); | p is a function | an argument as character array | a pointer to an integer |
int *p(char (*a) []); | p is a function | an argument as pointer to a character array | a pointer to an integer |
int *p(char *a []); | p is a function | an argument as array of pointers to characters | a pointer to an integer |
int (*p) (char (*a) []); | p is a pointer to a function | as argument as pointer to a character array | an integer |
int *(*p) (char (*a) []); | p is a pointer to a function | an argument as pointer to a character array | a pointer to an integer |
int *(*p) (char *a []); | p is a pointer to a function | an argument as array of pointers to characters | a pointer to an integer |
int (*p [10]) (); | p is a 10 element array of pointers | to functions | each function returns an integer |
int (*p [10]) (char a); | p is a 10 element array of pointers to functions | each functions takes an argument as character | an integer |
int *(*p [10]) (char a); | p is a 10 element array of pointers to functions | each function takes an argument as character | a pointer to an integer |
int *(*p [10]) (char *a); | p is a 10 element array of pointers to functions | each function takes an argument as pointer to a character | a pointer to an integer |
These are explained as following below.
- p is a pointer to an integer.
int *p;
- p is a 10 element array of pointer to integer.
int *p[10];
- p is a pointer to a 10-element integer array.
int (*p)[10];
- p is a function that returns a pointer to an integer.
int *p();
- p is a function that takes an argument as pointer to a character and returns an integer.
int p(char *a);
- p is a function that takes an argument as pointer to a character and returns a pointer to an integer.
int *(char *a);
- p is a pointer to a function that takes as argument as pointer to a character and returns an integer.
int (*p) (char *a);
- p is a function that takes an argument as pointer to a character and returns a pointer to a 10 element integer array.
int (*p (char *a)) [10];
- p is a function that takes as argument as pointer to a character array and returns an integer.
int p(char (*a) []);
- p is a function that takes an argument as array of pointers to a characters and returns an integer.
int p(char *a []);
- p is a function that takes an argument as character array and returns a pointer to an integer.
int *p(char a []);
- p is a function that takes an argument as pointer to a character array and returns a pointer to an integer.
int *p(char (*a) []);
- p is a function that takes an argument as array of pointers to characters and returns a pointer to an integer.
int *p(char *a []);
- p is a pointer to a function that takes as argument as pointer to a character array and returns an integer.
int (*p) (char (*a) []);
- p is a pointer to a function that takes an argument as pointer to a character array and returns a pointer to an integer.
int *(*p) (char (*a) []);
- p is a pointer to a function that takes an argument as array of pointers to characters and returns a pointer to an integer.
int *(*p) (char *a []);
- p is a 10 element array of pointers to functions, each function returns an integer.
int (*p [10]) ();
- p is a 10 element array of pointers to functions each functions takes an argument as character, and returns an integer.
int (*p [10]) (char a);
- p is a 10 element array of pointers to functions, each function takes an argument as character, and returns a pointer to an integer.
int *(*p [10]) (char a);
- p is a 10 element array of pointers to functions, each function takes an argument as pointer to a character, and returns a pointer to an integer.
int *(*p [10]) (char *a);
Please write comments if you find anything incorrect. A gentle request to share this topic on your social media profile.