I'm trying to log a few values to a text file, but everytime I do it, it gives me this error:
[Error] 'save' was not declared in this scope
Here's the code:
#include "iostream"
#include "fstream"
using namespace std;
double n1, n2;
int main()
{
n1 = 1;
n2 = 2;
save(n1, n2)
}
int save(double a, double b)
{
ofstream log;
log.open("test.txt");
log << 1 << 2 << "\n";
log.close();
}
I'm new to C++ and programming in general, please explain in an easy way.
Thanks.