Skip to content

Instantly share code, notes, and snippets.

@asserchiu
Last active September 9, 2018 07:27
Show Gist options
  • Save asserchiu/817bf66ccf209e24d0fe to your computer and use it in GitHub Desktop.
Save asserchiu/817bf66ccf209e24d0fe to your computer and use it in GitHub Desktop.
C pointers.
char *x; // x: a pointer to char
char x[3]; // x: an array[3] of char
char x(); // x: a function() returning char
char *x[3]; // x: an array[3] of pointer to char
char (*x)[3]; // x: a pointer to array[3] of char
char **x; // x: a pointer to pointer to char
char *x(); // x: a function() returning pointer to char
char *x()[3]; // x: a function() returning array[3] of pointer to char
char (*x[])(); // x: an array[] of pointer to function() returning char
char (*x())(); // x: a function() returning pointer to function() returning char
char (*(*x)[])(int, int); // x: a pointer to array[] of pointer to function(int,int)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment