error function not declared in scope
<p>I'm trying to log a few values to a text file, but everytime I do it, it gives me this error:</p>

<p>[Error] 'save' was not declared in this scope</p>

<p>Here's the code:</p>

<pre><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 &lt;&lt; 1 &lt;&lt; 2 &lt;&lt; "\n";
    log.close();
}
</code></pre>

<p>I'm new to C++ and programming in general, please explain in an easy way.</p>

<p>Thanks.</p>