Skip to content

Instantly share code, notes, and snippets.

@housemeow
Created March 10, 2014 15:51
Show Gist options
  • Select an option

  • Save housemeow/9467660 to your computer and use it in GitHub Desktop.

Select an option

Save housemeow/9467660 to your computer and use it in GitHub Desktop.
int strcmp(const char* s1, const char* s2)
{
while(1)
{
if(*s1>*s2)
{
return 1;
}else if(*s1<*s2)
{
return -1;
}else if(*s1=='\0')
{
return 0;
}
s1++;
s2++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment