我遇到了这个错误:Linker error undefined reference to
WinMain @ 16'`
以下是代码:
#include<iostream>
#include<conio.h>
#include<math.h>
using namespace std;
double dist(double array1[4], double array2[4])
{
double Sum;
double distance;
for(int i=0;i<4;i++)
{
cout<<"Enter value of first coordinate";
cin >> array1[i];
cout<<"Enter value of second coordinate";
cin >> array2[i];
Sum = Sum + pow((array1[i]-array2[i]),2.0);
distance = sqrt(Sum);
}
cout << "DISTANCE: " << distance;
return distance;
}
我不明白代码的哪一部分是导致此错误的原因。