Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string.h>
- // using strchr
- #include <stdio.h>
- // using printf
- int main()
- {
- const char* input = "Foo Bar Baz";
- printf("Whole input: %s\n", input);
- for(const char* pos = input; (pos = strchr(pos, ' ')) != NULL; pos += 1)
- printf("One word less:%s\n", pos);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement