The complex statements of C and C ++ follow the right-left rule.
This rule helps you quickly determine the exact meaning of a complex statement.
/* <Br/> const and pointer <br/> are two headaches for countless C ++ beginners. <Br/> today, this method is simple: Start from the right, for example, if <br/> const char * const A <br/> is combined from right to left <br/> const is encountered, it indicates that a is a constant <br/> *, description A is a constant pointer <br/> char description A points to a character <br/> const description const points to a character constant <br/> thus: A is a constant pointer to a character constant. </P> <p> the following definition helps you understand this method. <Br/> char a ('V'); <br/> char * B (& A); <br/> const char C ('C '); <br/> const char * D; <br/> char * const E (& A); <br/> const char * const F (& C ); <br/> char ** g; <br/> const char ** h; <br/> char * const * I; <br/> const char * const J = ??; <Br/> Can you tell us what they represent? <Br/> */</P> <p> # include <iostream> <br/> using namespace STD; <br/> int main () <br/>{< br/> char a ('V'); // character variable </P> <p> char * B (& ); // character pointer </P> <p> const char C ('C'); // character constant </P> <p> const char * D; // pointer variable pointing to a character constant </P> <p> char * const E (& ); // a constant pointer to a character variable </P> <p> const char * const F (& C ); // a constant pointer to a character constant </P> <p> char ** g; // a pointer variable, it points to a pointer to a character variable </P> <p> const char ** h; // a pointer variable, it points to a pointer to a character constant </P> <p> char * const * I = ??; <Br/> const char * const J = ??; // Leave the two for your consideration </P> <p> return 0; <br/>}