Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<fstream>
- using namespace std;
- int main()
- {
- char arr[100];
- ofstream document;
- document.open("file.txt");
- cin.getline(arr, 100);
- document << arr << endl;
- document.close();
- ifstream newdoc;
- newdoc.open("file.txt");
- newdoc >> arr;
- cout << arr;
- newdoc.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment