
Al P. answered 06/05/19
Online Mathematics tutor
I suspect in the first case (*str), the linker assigns str to the address of the "hello" string, but the string is stored where the linker places constants. When you try to modify it, the system complains (try removing the str[0]='z' to see if it works without modification).
When you initialize with str[], the linker uses r/w storage to hold "hello" and therefore when you modify the first letter, everything is ok.