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:
#include<iostream>
#include<cmath>
#include<fstream>
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.
Please login or Register to submit your answer