Ask your own question, for FREE!
Computer Science 18 Online
OpenStudy (anonymous):

// Function to compare two character strings int compareStrings (const char s1[], const char s2[]) { int i = 0, answer; while ( s1[i] == s2[i] && s1[i] != '\0'&& s2[i] != '\0' ) ++i; if ( s1[i] < s2[i] ) answer = -1; /* s1 < s2 */ else if ( s1[i] == s2[i] ) answer = 0; /* s1 == s2 */ else answer = 1; /* s1 > s2 */ return answer; }

OpenStudy (anonymous):

I need to convert the program above to use character pointers instead of arrays. Anybody have any ideas on how to do this?

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!