typedef void (콜백) (int * p1, sStruct * p2);C에서 반복적으로 선언 함
typedef struct _sStruct
{
callback *funct;
}sStruct;
다음과 같은 선언이 C에 있습니다.이 반복 선언을 오류없이 컴파일하려면 어떻게해야합니까?
잠시 동안 : '*'앞에 구문 오류가 있습니다. 첫 번째 줄에는 토큰이 있습니다.
/* Tell the compiler that there will be a struct called _sStruct */
struct _sStruct;
/* Use the full name "struct _sStruct" instead of the typedef'ed name
"sStruct", since the typedef hasn't occurred yet */
typedef void (callback)(int *p1, struct _sStruct *p2);
/* Now actually define and typedef the structure */
typedef struct _sStruct
{
callback *funct;
} sStruct;
편집 : 유형 이름의 문제의 변화에 맞게 업데이트
"반복적 선언"이란 무엇입니까? 원형 선언 또는 자체 참조를 의미합니까? – progrmr