我一直想弄清楚为什么我会收到初始化错误:
int size = polygons[polyID].n;
Clipper clipper = Clipper();
Vertex tmp[50];
size = clipper.clipPolygon(polygons[polyID].n, polygons[polyID].p, tmp, CWll, CWur);
int x[size] = {};
int y[size] = {};
我得到的错误是:
Pipeline.cpp:89:8: error: variable-sized object may not be initialized
int x[size] = {};
^~~~
Pipeline.cpp:90:8: error: variable-sized object may not be initialized
int y[size] = {};
有没有人知道可能导致此问题的原因?