]> git.sur5r.net Git - cc65/blob - testcode/lib/strncmp-test.c
Merge pull request #849 from polluks/patch-4
[cc65] / testcode / lib / strncmp-test.c
1 #include <stdlib.h>
2 #include <stdio.h>
3 #include <string.h>
4
5 static const char S1[] = {
6     'h', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd', '\0', 'A'
7 };
8
9 static const char S2[] = {
10     'h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd', '\0', 'B'
11 };
12
13
14
15
16 int main (void)
17 {
18     char I;
19     for (I = 0; I < 20; ++I) {
20         printf ("%02d: %d\n", I, strncmp (S1, S2, I));
21     }
22     return 0;
23 }
24