C2065:未声明的标识符,庞大的结构,全局

时间:2019-03-13 15:13:25

标签: c++11

Visual Studio 2017,c ++代码,城市的点坐标; work_type = float或double

#include <cstdio>
#include <iostream>
#include <vector>
#include <set>
#include <cmath>
#include <algorithm>
#define work_type double

using namespace std;
//n <= 5 000
//-10 000 <= x, y <= 10 000
const int MAXN = 5000;
struct point {
    int x;
    int y;
    point operator-(point& b) {
        point out = { x - b.x, y - b.y };
        return out;
    }
};
work_type dist(point& a, point& b) {
    return sqrt(work_type(pow((a - b).x, 2) + pow((a - b).y, 2)));
}
point points[MAXN];
int main(){...}

Visual Studio表示在字符串中未声明MAXN。我在其中创建大量的结构。我不明白为什么

0 个答案:

没有答案