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

前端 未结 10 1133
甜味超标
甜味超标 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:40

    For C++ separate declaration and initialization like this..

    int a[n][m] ;
    a[n][m]= {0};
    

提交回复
热议问题