Question: In c language . I5 points] char replace (char s, char *pat, char rep) Returns a copy of the string s, but with each instance
. I5 points] char "replace (char "s, char *pat, char rep) Returns a copy of the string s, but with each instance of pat replaced with rep, note that len (pat) can be less than, greater than, or equal to len (rep). The function allocates memory for the resulting string, and it is up to the caller to free it. For example, if we call replace ( "NBA X", "", "rocks"), what is returned is the new string NBA rocks (but remember, pat could be longer than an individual character and could occur multiple times). [5 points] char str_connect (char strs, int n, char c) Retums a string consisting of the first n strings in strs with the character c used as a separator. For example, if strs contains the strings ("Washington", "Adams", "Jefferson") and c is + the function retums the string "Washington+Adams+Jefferson" [5 points] void rm_ empties (char *words) words is an array of string terminated with a NULL pointer. The function removes any empty strings (ie, strings of length 0) from the array. [5 points] char *str_chop_all (char s, char c) urns an array of string consisting of the characters in s split into tokens based on the delimeter c, followed by a NULL pointer. For example, if s is "I am ready for a nice vacation and c is' it retums("I""am" "ready", "for", "a","nice", "vacation", NULL Pointer vs Array Notation Though it's not a formal requirement, it is suggested that you try to do some of these using pointer notation instead of array notation. . I5 points] char "replace (char "s, char *pat, char rep) Returns a copy of the string s, but with each instance of pat replaced with rep, note that len (pat) can be less than, greater than, or equal to len (rep). The function allocates memory for the resulting string, and it is up to the caller to free it. For example, if we call replace ( "NBA X", "", "rocks"), what is returned is the new string NBA rocks (but remember, pat could be longer than an individual character and could occur multiple times). [5 points] char str_connect (char strs, int n, char c) Retums a string consisting of the first n strings in strs with the character c used as a separator. For example, if strs contains the strings ("Washington", "Adams", "Jefferson") and c is + the function retums the string "Washington+Adams+Jefferson" [5 points] void rm_ empties (char *words) words is an array of string terminated with a NULL pointer. The function removes any empty strings (ie, strings of length 0) from the array. [5 points] char *str_chop_all (char s, char c) urns an array of string consisting of the characters in s split into tokens based on the delimeter c, followed by a NULL pointer. For example, if s is "I am ready for a nice vacation and c is' it retums("I""am" "ready", "for", "a","nice", "vacation", NULL Pointer vs Array Notation Though it's not a formal requirement, it is suggested that you try to do some of these using pointer notation instead of array notation
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
