I want to change a C++ string at a particular index like this:
string s = \"abc\"; s[1] = \'a\';
Is the following code valid? Is this an a
Yes. The website you link has a page about it. You can also use at function, which performs bounds checking.
http://www.cplusplus.com/reference/string/string/operator%5B%5D/