1,const int * a=&b;
when "const" on the left "*",specifies a const variable that is
referenced by a.
2.int * const a=&b;
when "const" on the right "*",specifies a const pointer.
What about
int const * a = &b;
?
The thing is: Your 'rule' is mighty complicated.
Much simpler:
const always works on the thing to its left.
Unless const is the leftmost specifier, in which case
it works on the thing immediatly to its right.
So, in
const int * a
the const works on the thing immediatly to its right:
It is the int, that is const
int * const a
const is not the leftmost specifier, thus it works on the thing
to its left: it is the pointer that is const.
int const * a
const is not the leftmost specifier, thus it works on the thing
to its left: it is the int that is const.