Answered step by step
Verified Expert Solution
Link Copied!

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
Do not use String.h library
image text in transcribed
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

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

MySQL/PHP Database Applications

Authors: Jay Greenspan, Brad Bulger

1st Edition

978-0764535376

More Books

Students also viewed these Databases questions