So I have this very basic code that should work, however, I keep getting two errors:
1. Method 'open' could not be resolved.
2. Method 'close' could not be resolved.
I'm new to C++, but I've seen this used tons of other places, but yet its not working for me. Would someone please explain to me what exactly is going on? Here is the code:
#include <iostream>
#include <fstream>
using namespace std;
int main() {
ofstream myfile;
myfile.open ("example.txt");
myfile << "Writing this to a file.\n";
myfile.close();
return 0;
}
I have a similar, longer program I'm working with and the something is occurring. Thanks!