Question: int compare(char * S1 , char *S2, int n) { Using pointer notation only, write a function that accepts two arrays of characters (two strings)

 int compare(char * S1 , char *S2, int n) { Using

int compare(char * S1 , char *S2, int n) {

Using pointer notation only, write a function that accepts two arrays of characters (two strings) Si and S2 as parameters. The function should compares the first n characters in the two strings and returns 1 if they are equals, otherwise 0 will be returned. (You may NOT use any of the string functions) Example : char sl [10] = ""this is a test"; char s2[10] = "this is an example"; cout

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!