Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdlib.h>
- #include <fstream>
- using namespace std;
- int main()
- {
- ofstream file1("c++test.txt");
- string text;
- cout << "Send some text into the file. :)" << endl;
- cin >> text;
- file1 << text << endl; //We inserted "Hello" into the file.
- ifstream file1_read("c++test.txt");
- file1_read >> text;
- cout << text << endl;
- }
Add Comment
Please, Sign In to add comment