Created
July 27, 2019 05:56
-
-
Save surinoel/01e4f075f27fbc7bfe7803c3e496e657 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <string.h> | |
| int main(void) { | |
| char buf[30] = "1,2,3,4,5,6"; | |
| char *ptr = strtok(buf, ","); | |
| while (ptr != NULL) { | |
| printf("%s\n", ptr); | |
| ptr = strtok(NULL, ","); | |
| } | |
| return 0; | |
| } | |
| #if 0 | |
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| #endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment