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 are the methods of exporting a function from a dll?

865


Where Malloc(), Calloc(), and realloc() does get memory?

830


Where can I run c++ program?

829


what is pre-processor in C++?

825


What are the implicit member functions of class?

828


What problems might the following macro bring to the application?

813


What is c++ virtual inheritance?

833


Explain the advantages of using friend classes.

844


What is the meaning of c++?

787


Does there exist any way to make the command line arguments available to other functions without passing them as arguments to the function?

996


What are the advantages of using friend classes?

881


What is the outcome of cout< a) 16 b) 17 c) 16.5

781


Which software is used for c++ programming?

832


What are libraries in c++?

805


When do you call copy constructors?

887