11 strncpy(a
, "gosh", 2);
14 printf("%d\n", strcmp(a
, "apple") > 0);
15 printf("%d\n", strcmp(a
, "goere") > 0);
16 printf("%d\n", strcmp(a
, "zebra") < 0);
18 printf("%d\n", strlen(a
));
23 printf("%d\n", strncmp(a
, "apple", 2) > 0);
24 printf("%d\n", strncmp(a
, "goere", 2) == 0);
25 printf("%d\n", strncmp(a
, "goerg", 2) == 0);
26 printf("%d\n", strncmp(a
, "zebra", 2) < 0);
28 printf("%s\n", strchr(a
, 'o'));
29 printf("%s\n", strrchr(a
, 'l'));
30 printf("%d\n", strrchr(a
, 'x') == NULL
);
32 memset(&a
[1], 'r', 4);
38 printf("%d\n", memcmp(a
, "apple", 4) > 0);
39 printf("%d\n", memcmp(a
, "grgr", 4) == 0);
40 printf("%d\n", memcmp(a
, "zebra", 4) < 0);
45 /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/