I believe it is since whenever I try to do
str1[0] = 'A';
or
str2[0] = 'A';
I get the exact same error, namely "you cannot assign to a variable that is const"
I just want to make sure
Well don't I feel sheepish. I have never come across the desire or need to actually do what I posted but you are right... although it did compile and run (and even printed out "Moo" before the segfault) it was obviously wrong. I suppose I figured that somehow there was an implicit conversion that dealt with the const-ness of assigning a string literal. Thanks for the lesson.
Really?? so then how would you initialize a pointer to a variable char???
is it possible to initialize a pointer to a char so that it points to "something" after the declaration-initialization?