I am getting an ofstream error in C++, here is my code
#include <iostream>
int main() {
std::ofstream myfile;
myfile.open("example.txt");
myfile << "Writing this to a file.\n";
myfile.close();
return 0;
}
error from Dev-C++ 10
C:\devp\main.cpp aggregate `std::ofstream OutStream' has incomplete type and cannot be defined