i am trying to create array of structure. Method i was using for creating array of structure which was working fine in Linux and Mac but this is throwing error in windows
uint32_t size;
Test TestArray[size];
TestArray[i] = Test;
//i
Error I am getting in windows
error C2131: expression did not evaluate to a constant
I have also tried
typedef struct Test {
char *x;
char *y;
} Test;
uint32_t size;
status = napi_get_array_length(env,args[2],&size);
assert(status == napi_ok);
struct Test testList[size];
napi_value SharePrefixObject;
for(uint32_t i=0;i<size;i++){
Test t;
testList[i]= t;
Question How can resolve above error ?