Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main()
- {
- ofstream file1("wtfm8.txt");
- if(file1.is_open()) //If file1 is ascossiated with a file in this case wtm8.txt
- {
- cout << "File is open." << endl;
- }
- else
- {
- cout << "File is not open." << endl;
- }
- file1 << "hello nerd!\n";
- file1.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement