Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I'm stuck on working through the following char *mystrrchr(const char *pc, int iChar); All others I don't need help with its only this last one
I'm stuck on working through the following "char *mystrrchr(const char *pc, int iChar);" All others I don't need help with its only this last one which I previously stated in quotes, thank you.
Note: Function strcat() also returns the destination string, but that return value is often ignored. (s) The strrchr() function returns a pointer to the last occurrence of character in the C string str. The terminating null-character is considered part of the C string. Therefore, it can also be located to retrieve a pointer to the end of a string. Example: / strrchr example */ char str[] = "This is a sample string"; char * pch; pch=strrchr (str,s); The pointer pch points to 's' at position 18. Assignment Directions Your task in this assignment is to complete your own versions of these five commonly used standard string functions. Each of your functions should have the same behavior as the corresponding C standard string function. For example, your mystrlen function should behave similarly to the C standard strlen function. Your functions should not call any of the standard string functions. In the context of this assignment, you should pretend that the standard string functions do not exist. call mystrlen("') returns 0. First create a header file named mystring.h containing the interface to your functions. The interface should consist of a set of function declarations. Then create a file named mystring.cpp containing the implementation of your functions, that is, a set of function definitions. It should "\#include" the interface file to ensure that each function definition is consistent with its declarationStep 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