Garmaine Staff asked 2 years ago

I am trying to create a .dat file using fout in visual studio 2019 but I am encountering the following error

fatal error LNK1169: one or more multiply defined symbols found 1>Done building project "project.vcxproj" — FAILED.

Here is my code:

using namespace std;
int main()
    ofstream fout("sin.dat");
    for (int i = 0; i < 100; i++)
        fout << i << "   " << sqrt(i) << endl;
    return 0;

Please help me to create and write a simple file. I am new in visual studio. Thanks in advance.