Answer Posted / bin
Here is a subroutine that does strcpy, returns 0 if both are equal, returns a positive number, if arg1 is higher else returns a negative number
int mystrcmp(char *s1, char *s2)
{
while (*s1 != 0 && *s2 != 0 && *s1 == *s2) {
++s1; ++s2;
}
return (*s1) - (*s2);
}
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Write the syntax and purpose of a switch statement in C.
define string ?
What are the basic data types associated with c?
Can you please explain the difference between syntax vs logical error?
Is stack a keyword in c?
What is the acronym for ansi?
What does main () mean in c?
Why is C language being considered a middle level language?
What is a global variable in c?
What is chain pointer in c?
What is extern c used for?
How can I make it pause before closing the program output window?
Which control loop is recommended if you have to execute set of statements for fixed number of times?
What are bitwise shift operators in c programming?
Why are all header files not declared in every c program?