aboutsummaryrefslogtreecommitdiff
path: root/tst/strtok.c
diff options
context:
space:
mode:
authorbeber <beber>2005-10-18 15:12:03 +0000
committerbeber <beber>2005-10-18 15:12:03 +0000
commit15d25eb73177811ae87e8b5fa10e06f1aec9f9b9 (patch)
treeabbf538e3daee1c1c97c8280b9c9a6042bb0aed6 /tst/strtok.c
parentdel string_upper, use strcasecmp (diff)
downloadespik-15d25eb73177811ae87e8b5fa10e06f1aec9f9b9.tar.xz
add a test
Diffstat (limited to 'tst/strtok.c')
-rw-r--r--tst/strtok.c23
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;
+}