Question: Using pointer notation create three string functions. #include stdio.h> include stdbool.h> int stringlength(char string); bool stringcomparenunberofchars (charstring1, char string2, int n) bool stringcontains(char *strl, char

 Using pointer notation create three string functions. #include stdio.h> include stdbool.h>

Using pointer notation create three string functions. #include stdio.h> include stdbool.h> int stringlength(char string); bool stringcomparenunberofchars (charstring1, char string2, int n) bool stringcontains(char *strl, char *str2)i int main) char test1 [1001: char test2[1001 printf"Enter Longer String" scanfc",test1) printf("Enter Shorter String") scanf"",test2):s f(stringlength(testl)stringlength(test2) printf"Your strings were not as we wished ") return 0: f(stringcontains [test1, test2)=true) printf("Yup yupin") return 0; Do not use array notation to implement these functions, use pointer notation. The first function, stringlength, simply returns the length of the string The second function compares the first n characters of string1, and string 2. So If I pass in the strings Hello World, Hello, and the integer 2, it should compare the first two characters of Hello World and Hello to see if they match. Finally, the third function, stringcontains checks to see if a longer string str1, contains a shorter string, str2. Use stringlenth and stringcomparenumberofchars, to write this function while using pointer notation. If you do it right you can do this in 5 lines of code, including the return statement. If you find your function has more than 7 lines you should rethink your algorithm

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!