Suppose that I have an array(local to a function) and a pointer
char a[]="aesdf"
and char *b="asdf"
My question is whether in the former case the string literal "aesdf"
is stored in read only section and then copied on to the local array or is it similar to
char a[]={'a','e','s','d','f','\0'};
?
I think that in this case the characters are directly created on the stack but in the earlier case (char a[]="aesdf"
) the characters are copied from the read only section to the local array.
Will `"aesdf" exist for the entire life of the executable?