Question: This program is in C. I would appreciate your help. Write a function to shorten a string by three characters. If the initial length is

 This program is in C. I would appreciate your help. Write

This program is in C. I would appreciate your help.

Write a function to shorten a string by three characters. If the initial length is less than three (not including the null terminator), make the length zero. HINT: If the initial length is less than three, make the character at index 0 a null character, otherwise overwrite the third-to-last character by a null character. You can assume string.h has been included so that you can use the function strlen(), void ShortenStringByTwo (char text[]) { Include the entire function in your answer (and only the function)

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!