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

What is flush () in c++?

570


What's the order in which the objects in an array are destructed?

838


What's the order in which the local objects are destructed?

826


Describe protected access specifiers?

665


How are pointers type-cast?

633






What is c++ used for in games?

594


What is vector processing?

657


What is an inclusion guard?

609


What are arithmetic operators?

525


What are the basics of local (auto) objects?

619


Is it possible to get the source code back from binary file?

702


What is a manipulative person?

529


Explain Text Manipulation Routines?

632


What are pointer-to-members? Explain.

618


What do nonglobal variables default to a) auto b) register c) static

635