Answer Posted / lylez00
#include <string.h>
/* strcmp */
int (strcmp)(const char *s1, const char *s2)
{
unsigned char uc1, uc2;
/* Move s1 and s2 to the first differing characters
in each string, or the ends of the strings if they
are identical. */
while (*s1 != '\0' && *s1 == *s2) {
s1++;
s2++;
}
/* Compare the characters as unsigned char and
return the difference. */
uc1 = (*(unsigned char *) s1);
uc2 = (*(unsigned char *) s2);
return ((uc1 < uc2) ? -1 : (uc1 > uc2));
}
Is This Answer Correct ? | 7 Yes | 3 No |
Post New Answer View All Answers
What is meaning of in c++?
Explain data encapsulation?
Differentiate between the message and method in c++?
In c++, what is the difference between method overloading and method overriding?
What is type of 'this' pointer?
What is a constant reference?
What is the difference between object-oriented programming and procedural programming?
Explain about vectors in c ++?
Specify some guidelines that should be followed while overloading operators?
What is the use of endl in c++?
What is the difference between #import and #include in c++?
Explain what you mean by a pointer.
What is the type of 'this' pointer?
How would you use the functions randomize() and random()?
Write a program to add three numbers in C++ utilizing classes.