Question: Problem 1 : Pointer - based Functions ( 2 5 points ) Write a program in which you create four functions that work with C
Problem : Pointerbased Functions points
Write a program in which you create four functions that work with Cstyle strings. These functions must use pointers in their implementation and must not use any C library code.
The functions to implement are:
lengthwhich determines how many characters are in the string; its parameter is a pointer to the C style string; its output value is a number representing the count of characters in the string which might be zeronote that the input string is not modified
indexof which determines the index location of a character; its parameters are a pointer to the Cstyle string and a character which is to be searched for; its output value is a number representing the first lowest index of the character or if the character is not found in the stringnote that the input string is not modified
replace which changes every occurrences of a character within the string with a different character; its parameters are a pointer to the Cstyle string, a character representing the character to replace, and another character representing the character that each found occurrence is changed to; the output value is a pointer to the input string which permits easier coding for the client codenote that the input string is modified concat which produces a new Cstyle string being the concatenation of two input strings; its parameters are two pointers to strings; the output value is a pointer to a newly created string which is a copy of the first string followed by a copy of the secondnote that the input strings are not modified and that the client code should delete the new string before exiting the program
Write a program that tests each function and displays the results of their use.
Design, edit, run, test, and debug your program. Enter the completed C code here:
C code for the lab project:
Run the code, take a screenshot of the results, and insert the screenshot here:
Screenshot of the results:
Problem : Reading and Writing Text Files points
Write a program in which you read an existing text file which contains multiple lines, some of which are blank. Open an output file and write to it the nonblank lines.
Display the input and output files after the program runs to demonstrate proper results.
Design, edit, run, test, and debug your program. Enter the completed C code here:
C code for the lab project:
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
