Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this program, you will write your own versions of two string library functions. Those functions are: char * mystrcat ( char * dest, char
In this program, you will write your own versions of two string library functions.
Those functions are:
char mystrcatchar dest, char src: Concatenates string in character array src to string in array dest. Returns dest when complete.
Recall that string concatenation adds one string to the end of another, thus creating a longer string. So if char s "EECE" and char s calling mystrcats s would change the contents of s to "EECE
char myfgetschar str int n FILE fp: Read line of input up to n characters into str from input source fp which can refer to an input file or stdin. Returns str when done.
This function should read characters from its input source and store them in the array str until either a newline
is read and stored, or the maximum number of characters is reached.
So for example, given char s and user input "This is a string." with a newline after the period:
Calling myfgetss stdin would set s "This is a string.
the newline character wouldn't appear in this way, but it would be in the array
Calling myfgetss stdin would set s "This"
Make sure both functions ensure the resulting string is nullterminated when it's done!
In the file below, you should leave the main function unchanged. The function definitions you need to write are listed at the top of the file.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started