Yes, in C language we cannot modify a string literal as it is meant to be a constant.
A string literal is something which is not allocated a memory by the programmer so that he can modify it. For example when one uses
printf("a=%d", a);
"a=%d" is a string literal which is stored in the process address space but not in a writable region so that one could modify it. Similar is the case when one do
char *a = "hello";
Now, in the given code "A" and "B" are string literals. So, we cannot modify their contents. i.e., we cannot do
*(s.a) = 'f';
But we can do
s.a = "U";
as here we have another string literal "U" and s.a is made to point there without actually modifying "A".