string s = "hello";
declares a string literal. By definition, it is immutable. If you try to change a char in that string, you will segfault.
Have a look at my post about string literals for more info.
Also, you'll learn more about this in Week 4, but your line
string s_capital = s;
does not make a copy of the string called s
. It simply creates a new variable that "points" to the same part of memory. That is why you cannot change s_capital
either.