DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
String Equality Tester
If you want to test the equality of two strings and don't want the overhead of strcmp(), then this is the function for you.
_Bool strequals(char* a, char* b) {
if (!a || !b) return 0;
do {if (*a != *b) return 0; } while (*a++ && *b++);
return 1;
}






Comments
Snippets Manager replied on Sat, 2009/05/02 - 1:40am
Snippets Manager replied on Mon, 2007/08/06 - 4:57am
Snippets Manager replied on Fri, 2007/08/03 - 6:57am