Question: Create a file lab03strings.c. Write the following function definition in it and test it from main: deleteSub - this function takes a string and two

Create a file lab03strings.c. Write the following function definition in it and test it from main: deleteSub - this function takes a string and two integers that indicate the starting and the ending index of a substring to be deleted from the incoming string (it does not return via a return statement). For example, the call deleteSub(hello, 2, 3) should result in the incoming string becoming "heo" in main. Remember that the physical length of a string is different than its logical length, indicated by the null character, i.e. the physical length of the incoming string does not change. Assume that the indices passed to the function will be valid for the given string, i.e. no error checking required. Test this function by calling it from main. While testing in main, refer to one of the lecture research questions which strings are actually modifiable in C. Once the program runs properly, check your code and tests for memory leaks and memory errors with Valgrind and apply more fixes, as needed to get a clean report.

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!