#include<stdio.h>
#include<stdlib.h>
#include <string.h>
typedef struct info{
int vreme_pojavljivanja;
int vreme_uklanjanja;
char *tekst;
}Info;
typedef struct clan{
Clan *prethodni;
Clan *sledeci;
Info *prevod;
}Clan;
Clan *novi_clan(char *tekst, int vreme_poc, int vreme_kraj, int max_text);
这是我的Strukture.h文件不能找到一个错误,但它给了我一个
,这是我novi_clan.c文件
#include "strukture.h"
Clan *novi_clan(char *tekst,int vreme_poc,int vreme_kraj,int max_text){
Clan *novi = malloc(sizeof(Clan));
novi->prethodni = NULL;
novi->sledeci = NULL;
novi->prevod = malloc(sizeof(Info));
novi->prevod->vreme_pojavljivanja = vreme_poc;
novi->prevod->vreme_uklanjanja = vreme_kraj;
novi->prevod->tekst = calloc(max_text, sizeof(char));
strcpy(novi->prevod->tekst, tekst);
return novi;
}
它给了我这样的错误是没有定义家族.. 如果有人看到一个错误,请回复它
的可能重复的[C:指针在结构定义为结构](http://stackoverflow.com/questions/506366/c-pointer-to-struct-in-the-struct-定义) – sth
@НиколаСпајић请“接受”最好的答案,这是如何工作,谢谢。 –