Implement strcmp

Answer Posted / shanmugavalli

int strcmp(const char *src, const char *dest)
{

while (*src && *dest && (*src==*dest))
{
src++;
dest++;
}
return (*src-*dest);

}

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

In inline " expression passed as argument are evalauated once " while in macro "in some cases expression passed as argument are evaluated more than once " --> i am not getting it plz help to make me understand....

2221


Which ide is best for c++?

783


Is java based off c++?

742


When is the destructor called?

820


Why do we need function?

819


What is class invariant in c++?

984


Define stacks. Provide an example where they are useful.

807


Is c++ a difficult language?

804


Is it possible to use a new for the reallocation of pointers ?

825


Explain the register storage classes in c++.

933


If a function doesn’t return a value, how do you declare the function?

834


Why can’t you call invariants() as the first line of your constructor?

794


What is an adaptor class in c++?

812


I want explanation for this assignment: how to connect mysql database using c/c++,please explain this detailly?

1843


What is an html tag?

857