0

I understand that the const keyword means that you can't change a variable's value so what does it mean if it used like this :

const char* const& message

  • that's a reference to a const pointer to a const char – sp2danny Apr 12 '15 at 22:56
  • Perhaps [this](http://stackoverflow.com/questions/1143262/what-is-the-difference-between-const-int-const-int-const-and-int-const?rq=1)? Or [this](http://stackoverflow.com/questions/89056/how-do-you-read-c-declarations?lq=1)? – chris Apr 12 '15 at 22:58

1 Answers1

2

The first const stays for the pointer reference itself cannot be changed, so you cannot do something like:

message = &something;

the second const is for the content of the pointer, so you cannot do something like:

*message = something;
T_01
  • 1,256
  • 3
  • 16
  • 35