Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<fstream>
- #include<string.h>
- using namespace std;
- int words(char *str)
- {
- char *delimitator = strtok(str, " ");
- while (delimitator != NULL)
- {
- cout << delimitator << endl;
- delimitator = strtok(NULL, " ");
- }
- }
- int main()
- {
- char *str = new char;
- ifstream in;
- in.open("test.txt");
- in.getline(str,256);
- words(str);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement