Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In c language Do not use String.h library 15 points) char *replace (char *s, char *pat, char *rep) Returns a copy of the string s,
In c language
15 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 1en (pat) can be less than, greater than, or equal to 1en (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", "x", "rocks"), what is retumed 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) Returns 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", "Ada","Jefterson") and c is the function retums the string "Washington+Adams+Jefferson" [5 points] void rm_empties (char "words) words is an aray of string terminated with a NULL pointer. The function removes any empty strings (.e, strings of length 0) from the array. [5 points] char *str_chop_all (char s, char c) Retuns an array of string consisting of the characters in s split into tokens based on the delimeter c, followed a NULL pointer. For example, if s is l arm ready for a nice vacation" and c is . it returns {"1", "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. For example, we could write a string length function as Do not use String.h library
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started