Strange, never had problems with such constructions. That's quite intuitive actually: first you create a const char array then assign a pointer to it and because this array ("string") is const, any modification is forbidden. That's all - no magic here. In other words, it all boils down to "arrays vs pointers" - a basics of C/C++.