6 ms·
The rationale is that the type declaration demonstrates how you use the variable. For example: char *(*fp)(int, float *) You now have a variable called "fp
by fexl 16y ago
The rationale is that the type declaration demonstrates how you use the variable. For example:
char *(*fp)(int, float *)
You now have a variable called "fp". Follow that pointer by putting a * in front of it. Call that function by passing it an int and a float pointer inside parentheses. Follow that pointer by putting a * in front of it. That gives you a char.
Same kind of thing here:
char *strings[10]
You now have a variable called "strings". Index that array by putting an offset less than 10 inside square brackets. Follow that pointer by putting a * in front of it. That gives you a char.
Here's a simpler example:
char *str
You now have a variable called "str". Follow that pointer by putting a * in front of it. That gives you a char.
Here's the simplest example of all:
char ch;
You now have a variable called "ch". That gives you a char.