How can I insert a character into a string exactly after 1 character?
I need to insert \'|\' into the string after every other char
You can use
string& insert (size_t pos, const string& str);
You would have to loop through the string, inserting a character each time.
for (int i = 1; i < str.size(); i++) { str << str.insert(i, '|'); i++; }