xref: /relibc/tests/string/strtok.c (revision ed19381547d66b76981ea1e4ff942c5a4da45ab7)
1 #include <string.h>
2 #include <stdio.h>
3 
4 #include "test_helpers.h"
5 
6 int main(void) {
7     char source[] = "I'd just like to interject for a moment.  What you're referring to as Linux, "
8                     "is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux.\n";
9 
10     char* token = strtok(source, " ");
11     while (token) {
12         printf("%s", token);
13         if ((token = strtok(NULL, " "))) {
14             printf("_");
15         }
16     }
17 }
18