i have the following code and the compiler is throwing error C2371: 'drawgraph' : redefinition; different basic types; on the header line of drawgraph(). I am relatively new to C so are you even allowed to do this? drawgraph isn't anywhere else in my program
Code:
void creategraph(int vertnumber){
int i = 0, j =0;
headedge = Create_Head_Edge();//create the head edge for the LL of edges
head = Create_Vertices(vertnumber);//creates the number of verticies based on the arguments
while(filevalues[i][j] != 0){//create the LL of edges
headedge = Insert_Edge_by_ID(headedge, head, filevalues[i][0], filevalues[i][1]);
i++;
}
drawgraph(head, headedge);
}
void drawgraph(struct Vertex* temphead, struct Edge* tempheadedge){ <- the error is thrown here
while(temphead != NULL){//traverses the LL
DrawCircle(temphead->x, temphead->y, 10, 1, Blue);//draws the vertices to the screen
temphead = temphead->next;//increment to the next vertex
}
while(tempheadedge != NULL){
if(tempheadedge->next == NULL)
break;
DrawLine(tempheadedge->vertex1->x, tempheadedge->vertex1->y, tempheadedge->vertex2->x, tempheadedge->vertex2->y, Black);
tempheadedge = tempheadedge->next;
}
}