Quote:
Originally Posted by Narue
When you initialize an array with a string literal, a copy of the string literal is stored in the array. You own the memory for the array, therefore you can modify the copy of the string literal (provided it's not declared as const). When you initialize a pointer with a string literal, the pointer points to the string literal itself. The reason you can't use b to modify the string literal is because string literals are read-only.
|
Does anyone know of an official source where I can find this information? (A link would be appreciated.) Thanks.