链接器错误未定义引用“WinMain @ 16”,ld返回1退出状态

时间:2014-01-15 00:50:52

标签: c++ arrays

我遇到了这个错误: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;
}

我不明白代码的哪一部分是导致此错误的原因。

0 个答案:

没有答案