Hi, I am writing a program that needs to take text input, and modify individual characters. I am doing this by using an array of characters, like so:
char s[] = "test";
s[0] = '1';
cout << s;
(Returns: "1est")
But if I try and use a variable, like so:
string msg1 = "test";
char s2[] = msg1;
s2[0] = '1';
cout << s1[0]
I get an error: error: initializer fails to determine size of 's2'
Why does this happen?