#include <stdio.h>
#include <stdlib.h>
typedef struct sommet sommet;
typedef struct voisin voisin;
typedef struct graphe graphe;
struct sommet{
int indice;
sommet* next;
voisin* first_voisin;
};
struct voisin{
int indice;
voisin* next_voisin;
};
struct graphe{
sommet* premier_sommet;
};
下面是一个简单的 struct 定义h程序. 我得到了一个Error:redefinition的 struct . 我该怎么解决这个问题? 谢谢!
我试着直接把
typedef struct sommet {
//code
};
并且还
typedef struct{
//code
}sommet;