I am trying to print into a file in C++ and for some reason I keep getting this weird error:
error C2061: syntax error : identifier 'ofstream'
I included the following:
#include <fstream>
#include <iostream>
This is my function:
void Date::PrintDate(ofstream& resultFile) const
{
resultFile << m_day << "/" << m_month << "/" << m_year;
}
I am using namespace std
.
I figured it out, it was all because I did not include the file in the right way.