Skip to content

Instantly share code, notes, and snippets.

@mlabbe
Created July 26, 2014 05:51
Show Gist options
  • Save mlabbe/fe7f4d0ac9380c425782 to your computer and use it in GitHub Desktop.
Save mlabbe/fe7f4d0ac9380c425782 to your computer and use it in GitHub Desktop.
Comparing strings
int Orion::Stricmp( const char *s1, const char *s2 )
{
const char *p1 = s1;
const char *p2 = s2;
int result = 0;
if ( p1 == p2 )
return result;
while (!result)
{
result = tolower(*p1) - tolower(*p2);
if ( *p1 == '\0' )
break;
++p1;
++p2;
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment