我有一个问题,如何创建一个数组vertextDegree [nbColours]
,其中包含nbColours
个元素,但"nbColours"是未知的,我必须从文件中获取它。
看一下代码,那么我应该怎么解决这个问题呢?
int nbEdges,nbVetices, nbColours ;
typedef struct st_graphVertex
{
int index;
int colour;
int val ;
int vertexDegree[nbColours]; // it won't work because nbColours unknown
// here and I want get it from file in the main
struct st_graphVertex *next;
t_edgeList *out;
}t_grapheVertex;