Question: Assignment Directions Your task in this assignment is to complete your own versions of these four most commonly used standard string functions. Your version: int

 Assignment Directions Your task in this assignment is to complete your

own versions of these four most commonly used standard string functions. Your

version: int mystrlen( const char s) int mystrcmp( const char *s1, const

Assignment Directions Your task in this assignment is to complete your own versions of these four most commonly used standard string functions. Your version: int mystrlen( const char s) int mystrcmp( const char *s1, const char *s2) int strcmp( const char *s1, const char *s2) char 'mystrcpy( char "s1, const char 's2) char 'strcpy( char 's1, const char 's2) char "mystrcat( char 's1, const char 's2) char "strcat( char "s1, const char "s2) C standard string library functions: int strlen( const char s) Each of your functions should have the same behavior as the corresponding above C standard string function. For example, your mystrlen function should have the same behavior as 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. You should pay special attention to boundary cases. In particular, make sure that your functions work when given empty strings as arguments. For example, make sure that the function call mystrlen()returns O 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 insure that each function definition is consistent with its declaration. You may use array notation to define your functions. For example, this is an acceptable version of the mystrlen function

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 Databases Questions!