

Quick case: Char Pointer vs. Char Array in C++ - signa11
http://www.bfilipek.com/2014/07/quick-case-char-pointer-vs-char-array.html#.U8VtnVFFOhg.reddit

======
captainmuon
This is one of these unexpected things that make C++ really annoying
sometimes. It would have been better to pick just one behavior and use it in
both cases. For example, make it mutable (array allocation) in both cases, and
if you really need to place the string in the RODATA block (to save memory for
repeated immutable strings for example), you could have a compiler directive.

~~~
tobinfricke
So, you're suggesting that we take a standard language feature and replace it
with an implementation-dependent one?

------
kbart
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++.

~~~
joebaf
still, it can happen and you get 'unexpected' runtime bug...

