Fast string comparison for microcontrollers (C/C++)

This short article presents trivial but fast and memory efficient function to compare two strings. Function returns “0” (zero) on success (strings are the same), otherwise function returns the position where different characters occurred. Example code #include <stdint.h> #include <assert.h> static int8_t xstrcmp(const char *s1, const char *s2) { while(*s1 != ‘\0’ && *s1 == … Read more