C compile error: “Variable-sized object may not be initialized”

前端 未结 10 1262
甜味超标
甜味超标 2020-11-22 07:22

Why do I receive the error \"Variable-sized object may not be initialized\" with the following code?

int boardAux[length][length] = {{0}};
10条回答
  •  野性不改
    2020-11-22 07:41

    Simply declare length to be a cons, if it is not then you should be allocating memory dynamically

提交回复
热议问题