I've just came up with this code on minute 1:06 of a coursera lecture. What does it do?
int (*cmp)(char*, char*);
This is a pointer to a function where the function returns an int and takes as argument two character pointers.
The basic rule boils down to few things:-
There are three simple steps to follow:
[X] or []
X
size of... or Array undefined size of...(type1, type2)
type1
and type2
returning...
*Reference: 1.Clockwise-rule 2.right-left rule
When you read C declarations you must read them butrophedonically (common way of writing in stone in Ancient Greece).
pointer to
function that
has (char*, char*) type parameters as input
and int as output
EDIT:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With