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
Explain a file operation in C with an example.
Differentiate call by value and call by reference?
What is else if ladder?
What does c mean in standard form?
In which language linux is written?
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
How do you define a function?
What is malloc() function?
Write a program to check prime number in c programming?
Given a valid 24 hour format time find the combination of the value and write a program ,do not hard the value and if any other inputs provided should work with the logic implemented Input: 11:30 Output: 13:10 Input: 18:25 Output: 21:58
Difference between exit() and _exit() function?
What is main return c?
What are the types of macro formats?
Explain goto?
Explain argument and its types.