This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int compare_some_strings (char *a, char *b) | |
// compare some strings, return -1 if equal, otherwise the position of the first difference. | |
{ | |
int i; | |
for (i = 0; a[i] != 0 && b[i] != 0; i++) | |
if (a[i] != b[i]) | |
return i; | |
// wenn wir hier angekommen sind, sind sie bis zum Punkt i gleich | |
if (a[i] == 0 && b[i] == 0) // sie sind ganz gleich |