내가 만든 트리 필드에서 정보를 얻으려고 노력하고, 내가 제목에 오류를 얻고있다 포인터를 역 참조 : 불완전한 타입에 대한 포인터를 역 참조오류 C - 불완전한 유형
트리 소스 파일 'List_t 구조체'를 :
struct Node_t{
Element data;
char* location;
struct Node_t* son;
struct Node_t* next;
};
struct List_t{
Node head;
copyFunc copyfunc;
compareFunc compfunc;
freeFunc freefunc;
printFunc printfunc;
};
트리 헤더 파일 :
typedef struct Node_t* Node;
typedef struct List_t* Tree;
typedef void* Element;
응용 프로그램 소스 파일 :
Tree t;
t = createTree(compareInt, copyInt , freeInt, printInt);
int* x =(int*)malloc(sizeof(int));
*x=53;
Add(t, x);
char* location;
location= t->head->location; //here I got the error
printf(location);
어떻게해야합니까? 내가 도대체 뭘 잘못하고있는 겁니까?
감사합니다.
[둘러보기], 특히 [질문]을 가져 가야합니다. – Yunnosch
실제 오류 메시지를 질문에 복사 해 주셔서 감사합니다. 자, 필요한 모든 코드를 질문에 복사하십시오. 여기 링크를 거절하는 유능하고 일반적으로 도움이되는 사람들이 있습니다. 따라서 스크린 샷 바로 가기를 사용하여 좋은 응답 기회를 줄이는 것입니다. – Yunnosch
감사합니다. @Yunnosch 내가 편집했습니다. 지금 그것이 의미가 있기를 바란다. – MaorE