- char old_c = NewName.at(pos);
- char new_str[16];
- sprintf(new_str, "%d", (int)old_c);
- NewName = NewName.replace(pos, 1, new_str);
+ std::ostringstream NumStream;
+ NumStream << (int)NewName.at(pos);
+ NewName = NewName.replace(pos, 1, NumStream.str());