Question: Complete function trim_blanks whose purpose is to take a single string input parameter ( to_trim) and return a copy of the string with leading and

Complete function trim_blanks whose purpose is to take a single string input parameter ( to_trim) and return a copy of the string with leading and trailing blanks removed. Use strncpy in trim_blanks. Also, provide the complete C code by calling the function from main. a_string (before) phra 10 n_string (after the call: trim_blanks (n_string, a_string);) phrase 10 a char * trim_blanks (char *trimmed, /* output */ const char *to_trim) /* input */ { /* Find subscript of first nonblank in to_trim */ /* Find subscript of last nonblank in to_trim /* Use strncpy to store trimmed string in trimmed */

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 Programming Questions!