diff options
author | beber <beber> | 2005-10-18 15:12:03 +0000 |
---|---|---|
committer | beber <beber> | 2005-10-18 15:12:03 +0000 |
commit | 15d25eb73177811ae87e8b5fa10e06f1aec9f9b9 (patch) | |
tree | abbf538e3daee1c1c97c8280b9c9a6042bb0aed6 /tst | |
parent | del string_upper, use strcasecmp (diff) | |
download | espik-15d25eb73177811ae87e8b5fa10e06f1aec9f9b9.tar.xz |
add a test
Diffstat (limited to 'tst')
-rw-r--r-- | tst/strtok.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tst/strtok.c b/tst/strtok.c new file mode 100644 index 0000000..a25dd7c --- /dev/null +++ b/tst/strtok.c @@ -0,0 +1,23 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +int main() +{ + char msg[] = "toto tata titi"; + char* ptr; + char* p; + + p = msg; + + do + { + ptr = strchr(p, ' '); + ptr++; + printf (":%s:\n", ptr); + p++; + } + while (*p); + + return 0; +} |