Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- using namespace std;
- int main()
- {
- int n = 1;
- string* str = new string[n];
- ifstream file("file.txt");
- int i = 0;
- while (getline(file, str[i],' ')) {
- i++;
- n++;
- }
- cout << str[1];
- delete[] str;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement