C++: Const rule (or rule the const)

how about:

  1. const char *
  2. char const *
  3. char * const

“const applies to what is on its left”
So 1 and 2 are the same, they both point to fixed text with variable pointer. 3 has fixed pointer with variable text. If const is first, move it one token to the right.

this is just a reminder for myself 😉

Published by

Leave a Reply

Your email address will not be published.