Question: 30 Q2. 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
30

Q2. 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) phr 10 n_string (after the call: trim_blanks (n_string, a_string);) phrase 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 1* Use strncpy to store trimmed string in trimmed */ }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
