Vergleicht 2 gegebene Strings miteinander; zuerst auf gleiche Länge, danach auf Gleichheit der einzelnen Zeichen.
Parameter:#include <string.h> uint8_t MyStrCmp(char *src1, char *src2) { uint8_t cnt = 0; uint8_t len1 = 0; uint8_t len2 = 0; len1 = strlen(src1); // Get length from first string len2 = strlen(src2); // Get length from seconds string if (len1 != len2) { // if sources have different lengths: difference is obvious return 0; } while (src1[cnt]) { if (src1[cnt] != src2[cnt]) { // String mismatch found: difference return 0; } cnt++; } // Strings have the same length and there is no difference: identical return 1; }