char* insert_char(char* str, uint_t pos, char ch)
{
uint_t len = strlen(str);
char* new_str = new char[len+1];
if (pos != 0)
memcpy(new_str, str, pos * sizeof(char));
new_str[pos] = ch;
if (pos != len)
memcpy(&(new_str[pos+1]), &str[pos], (len - pos) * sizeof(char));
return new_str;
}