Declare all variables/qualifiers right-to-left. Read the type for all the below right-to-left, substituting the word "pointer" for "*". int long long unsigned wibble; // unsigned long long int double const *long_number; // pointer to a const double double volatile * const immutable_pointer; // immutable pointer to a volatile double They all read correctly now, when read right-to-left. It's not just "const" you do thi…
What's the author's justification? What's your justification? > They all read correctly now, when read right-to-left. ... suppose I'm someone who reads from left-to-right, should I flip the order to make it correct for me?
I’m neither of them, but chances are that’s because you can’t make them left-to-right all the time.
double const *foo; // foo is a pointer to a const double
double *const foo; // foo is a const pointer to a double
compile and do what the comment says; these do not compile: * const double foo; // a pointer to a const double named “foo”
foo * const double; // foo is a pointer to a const double