我想在结构中包含一个可变长度数组,但是在正确初始化它时遇到了问题.
struct Grid { int rows; int cols; int grid[]; } int main() { struct Grid testgrid = {1, 3, {4, 5, 6}}; }
我尝试的一切都给了我一个'错误:灵活数组成员的非静态初始化'错误.
c struct
c ×1
struct ×1