Question: Complete the following program in C coding language, not C + + . There should be 3 seperate files in the end, string _ utils.h

Complete the following program in C coding language, not C++. There should be 3 seperate files in the end, string_utils.h, string_utils.c, and stringsTester.c
To get more practice working with strings, you will write several functions that involve operations on strings. In particular, implement the following functions with the described behavior. You must use the given signatures.
Write a function that replaces instances of a given character with a different character in a string.
void replaceChar(char *s, char oldChar, char newChar);
Which will replace any instance of the character stored in oldchar with the character stored in newchar in the string s.
Write a function that takes a string and creates a new copy of it but with instances of a given character replaced with a different character.
char * replaceCharCopy(const char *s, char oldChar, char newChar);
Write a function that takes a string and removes all instances of a certain character from it.
void removeChar(char *s, char c);
When removing characters, all subsequent characters should be shifted down. Take care that you handle the null terminating character properly.
Write a function that takes a string and creates a new copy of it but with all instances of a specified character removed from it.
char * removeCharCopy(const char *s, char c);
Take care that the new copy does not waste memory.
Write a function that takes a string and splits it up to an array of strings. The split will be length-based: the function will also take an integer n and will split the given string up into strings of length n. It is possible that the last string will not be of length n. You will not need to communicate how large the resulting array is as the calling function knows the string length and n.
char **lengthSplit(const char *s, int n);
For example, if we pass "Hello World, how are you?" with n=3 then it should return an array of size 9 containing the strings "Hel", "lo", "Wor", "ld,"," ho","w a","re ", "you", "?"
Instructions
Place all your function prototypes into a file named string_utils.h and and their definitions in a file named string_utils.c.
In addition, create a main test driver program called stringTester.c that demonstrates at least 3 cases per function to verify their output. Hand in your tester.
Complete the following program in C coding

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!