GCC: array type has incomplete element type

前端 未结 2 1291
星月不相逢
星月不相逢 2020-12-01 06:38

I have declared a struct, and I try to pass an array of those structs (as well as a double array of doubles, and an integer) into a function. I get an \"array type has incom

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-01 07:10

    The compiler needs to know the size of the second dimension in your two dimensional array. For example:

    void print_graph(g_node graph_node[], double weight[][5], int nodes);
    

提交回复
热议问题