Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In c language . I5 points] char replace (char s, char *pat, char rep) Returns a copy of the string s, but with each instance

In c language
image text in transcribed
. 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Automating Access Databases With Macros

Authors: Fish Davis

1st Edition

1797816349, 978-1797816340

More Books

Students also viewed these Databases questions