4

I am aware of the following sequences :

  1. const char* - mutable pointer to an immutable character/strin
  2. char* const - an immutable pointer but the contents of location at which it points are mutable.
  3. const char* const - immutable pointer to an immutable character/string.
  4. char* - entirely permissive.

However are we supposed to interpret the following :

char const *

Is there a way to intuitively understand what 1 , 2 and the "new one" means - or we have to learn it by heart.

jithu83
  • 539
  • 6
  • 11

2 Answers2

2

The rule of thumb is "read it backwards". This answer explains it well.

Community
  • 1
  • 1
AShelly
  • 34,686
  • 15
  • 91
  • 152
1

it's equivalent to const char *

sithereal
  • 1,656
  • 9
  • 16