0

I have been trying to figure out why i'm getting an initialization error:

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] = {}; 

and the error I am getting is:

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] = {}; 

Does anyone have an idea of what might be causing this issue?

user4581301
  • 31,330
  • 6
  • 30
  • 51
MasterYork42
  • 230
  • 2
  • 11

0 Answers0