Various Declarations and Notations in C language

By | February 20, 2024

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.

  1. p is a pointer to an integer.
    int *p;  
  2. p is a 10 element array of pointer to integer.
    int *p[10];  
  3. p is a pointer to a 10-element integer array.
    int (*p)[10];  
  4. p is a function that returns a pointer to an integer.
    int *p();  
  5. p is a function that takes an argument as pointer to a character and returns an integer.
    int p(char *a);  
  6. p is a function that takes an argument as pointer to a character and returns a pointer to an integer.
    int *(char *a);  
  7. p is a pointer to a function that takes as argument as pointer to a character and returns an integer.
    int (*p) (char *a);  
  8. 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];  
  9. p is a function that takes as argument as pointer to a character array and returns an integer.
    int p(char (*a) []);  
  10. p is a function that takes an argument as array of pointers to a characters and returns an integer.
    int p(char *a []);  
  11. p is a function that takes an argument as character array and returns a pointer to an integer.
    int *p(char a []);  
  12. 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) []);  
  13. 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 []);  
  14. 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) []);  
  15. 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) []);  
  16. 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 []);  
  17. p is a 10 element array of pointers to functions, each function returns an integer.
    int (*p [10]) ();  
  18. 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);  
  19. 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);  
  20. 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.

Author: Mithlesh Upadhyay

Mithlesh Upadhyay is a Computer Science and AI expert from Madhya Pradesh with strong academic background (BE in CSE and M.Tech in AI) and over six years of experience in technical content development. He has contributed tech articles, led teams, and worked in Full Stack Development and Data Science. He founded the w3colleges.org portal for learning resources.