I have a string a = "Hello world!", now for fun I wish to change the first letter in the string a to a number of my choosing. for example
string a = "Hello world!";
int x;
std:cin>>x;
a[0] = x;
cout << a;
Now what i want it to produce is "xello world!" x being the number i typed in, but instead I get a little smiley face.
Anyone seen anything similar and know how to fix it?
Also: Why can you even access a string like this string[] ? it's not a char array o.o