I mean the way that is done in editors with insert key on.
So having string like:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The effect will be:
~~~~~~~~~~Hello!~~~~~~~~~~~~~~~~~~
that is without changing length of the string.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Overwriting a portion of a string is done with one of the several overloads of
std::string‘sreplacemember function, for example:You can play with this example at ideone [link].