Here's the code:
int EdgeCount = 0;
int numOfEdges = 0;
void addEdge() {
// some code
numOfEdges++;
}
int EdgeWeightArray[numOfEdges]; // error
I want that global array with variable parameters to use it later but I couldn't do that because without #define
we can't define globally arrays parameters; and #define
is not a variable thing. In my code numOfEdges
is variable and I couldn't make it constant.