Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <fstream>
- using namespace std;
- int main () {
- ofstream myFile("myTest.txt");
- if(myFile.is_open()){
- string uInput;
- cout << "Enter data to write: ";
- cin >> uInput;
- myFile << uInput;
- }else{
- cerr << "File Unable To Open!" << endl;
- }
- system("pause");
- return 0;
- }
Add Comment
Please, Sign In to add comment