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 seperate files in the end, stringutils.h stringutils.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 replaceCharchar 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 replaceCharCopyconst char s char oldChar, char newChar;
Write a function that takes a string and removes all instances of a certain character from it
void removeCharchar 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 removeCharCopyconst 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 lengthbased: the function will also take an integer and will split the given string up into strings of length It is possible that the last string will not be of length You will not need to communicate how large the resulting array is as the calling function knows the string length and
char lengthSplitconst char s int n;
For example, if we pass "Hello World, how are you?" with then it should return an array of size containing the strings "Hel", lo "Wor", ld how are "you",
Instructions
Place all your function prototypes into a file named stringutils.h and and their definitions in a file named stringutils.c
In addition, create a main test driver program called stringTester.c that demonstrates at least cases per function to verify their output. Hand in your tester.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
