Question: In C language, Write code for a function called addToString that takes in a dynamically allocated string to be added to. The function returns a
In C language,

Write code for a function called addToString that takes in a dynamically allocated string to be added to. The function returns a new string that contains the old string plus a new string (possibly with spaces) that the user inputs. For example if given a reference to a string that is Rob" and the user inputs "Miller is cool.", the function would return "Rob Miller is cool". The function returns the newly created string with the intent of assigning it to the original. The declaration for the function needs to look something like: newString addToString (Original String) The function would be called like: cPtr = addToString(cPtr); // cPtr - dynamically allocated null terminated string
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
