Skip to content

Instantly share code, notes, and snippets.

@H3xept
Created October 22, 2015 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save H3xept/27d2d06aaef6182207fa to your computer and use it in GitHub Desktop.
Save H3xept/27d2d06aaef6182207fa to your computer and use it in GitHub Desktop.
size_t custom_strlen(char* string)
{
size_t _strlen = 0;
while('\0' != *string)
{
string++;
_strlen++;
}
return _strlen;
}
unsigned int custom_strcmp(char* str1, char* str2)
{
unsigned int rt = 1;
for(int _strlen = custom_strlen(str1); _strlen > 0; _strlen--)
{
if(*(str1+_strlen) != *(str2+_strlen))
{
rt = 0;
break;
}
}
return rt;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment