-1

次のコードで「'Graph' のタイプが競合しています」というエラーが表示されますが、Graph はどこでも使用される前に宣言されているため、何が問題なのかわかりません。誰が問題が何であるか知っていますか?

#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#define __USE_BSD // make prototype for strdup visible
#include <string.h>

typedef struct linkedlist { // linked list of ints (for use in Node)
  int index;
  struct linkedlist *next;
} List;

typedef struct { // a Node of a Graph
  char *name;
  List *outlist; // adjacency list
  int outdegree; // length of outlist
  int indegree; // length of inlist
  int dfsnum;
  //double pagerank_score; //not needed for this exercise
} Node;

typedef struct {
  int MaxSize;
  Node *table;
} Graph;

// use to check result of strdup, malloc etc.
extern void check (void *memory, char *message);

extern int initialize_graph (Graph *mygraph, int MaxSize);
extern int insert_graph_node (Graph *mygraph, int n, char *name);
extern int insert_graph_link (Graph *mygraph, int source, int target);
extern int read_graph (Graph *mygraph, char *filename);
extern void print_graph (Graph *mygraph);
4

1 に答える 1