* create basic strtok

* add test and expected output
This commit is contained in:
Timothy Bess
2018-03-17 02:58:08 -04:00
parent bebbd35e1a
commit f60fafe8fb
6 changed files with 50 additions and 2 deletions
+15
View File
@@ -0,0 +1,15 @@
#include <string.h>
#include <stdio.h>
int main(int argc, char* argv[]) {
char source[] = "I'd just like to interject for a moment. What you're referring to as Linux, "
"is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux.\n";
char* token = strtok(source, " ");
while (token) {
printf("%s_", token);
token = strtok(NULL, " ");
}
return 0;
}