Because the first one is a string literal whose address you are assigning. And string literals are non modifiable. Though it looks similar to the second case it isnn't. The string literal which is an array decays into pointer which is assigned to the char*
.
Second one is simply initializing a local char
array. Here it is just initializing the element of the array with that of string literal. And this is modifiable.
char char_arr[]= {'a','n','i','s','h','a','\0'};
And this is modifiable as a normal char array can be.
From C11 standard 6.4.5p7
It is unspecified whether these arrays are distinct provided their
elements have the appropriate values. If the program attempts to
modify such an array, the behavior is undefined.