Why do I get a segmentation fault when writing to a “char *s” initialized with a string literal, but not “char s[]”?
The following code receives seg fault on line 2: char *str = “string”; str[0] = ‘z’; // could be also written as *str=”z” … Read more