E.g. typedef unsigned int uInt;
Here uInt will be synonym for type unsigned int.
The following line of code actually produces an int* which is x and an int (not an int*) which is y. That is, the ‘*’ binds to the right, not the left.
int * x, y;
However, if you use a typedef:
typedef int* intPtr;
intPtr x, y;
Then both x and y are of type int*.
No comments:
Post a Comment