So, I'm trying to use the string::replace() function in a program. My program as a whole wasn't working, so i created an absolutely minimal program consisting of only one line of code (inside the main() function; I won't put braces on a single line). It is like this:
cout << string("**********").replace(2,5,"......") << endl;
(the string of '.'s is intentionally 6 characters long)
The output I was expecting was:
Instead, I got:
as if all characters after the 5th in the replace() call were inserted, instead of replacing....
Jakykong (Jack Mudge)