...
/More Details on Reading Complex Declarations
More Details on Reading Complex Declarations
Solve a previous exercise using the rules for reading complex declarations. Distinguish between old and new rules in this lesson.
We'll cover the following...
Introduction
We can apply the rule for reading complex declarations to any construct inside the C language.
We can apply it to something as simple as int x
.
- Start from the identifier
x
. We read it and get "x
is." - We can’t move right.
- Move left to
int
. We read it and get "x
is anint
."
Particularizing the rule
Remember that when we first learned about pointers, we learned how to read such declarations:
const int* const ptr;
The rule was to always start from the right and go left, reading each keyword. This rule ...