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,

In C language, Write code for a function called addToString that takes

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 addToString() { }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!