new_str is also declared as a char -> Not a char* which you can malloc memory to and not an array.
Type: Posts; User: Click_here
new_str is also declared as a char -> Not a char* which you can malloc memory to and not an array.
The value of new_str[i] becomes what the function "insert" is returning.
And the function "insert" does not change the size of any character arrays. Instead it creates a new array of size...
And one more - What this one does
printf("The new string is: %s", new_str);
Tell us what you think that this line does?
new_str[i]= insert(origString, insertion_char, position_of_insertion);