나는 C++로 콜백 루틴을 선언하는 것을 시도하고있다 :"불완전한 유형이 허용되지 않습니다"라는 오류는 무엇을 의미합니까? 다음과 같이
line 204: error #70:
incomplete type is not allowed
void register_rename (int (*function) (const char *current, const char *new));
나는이 문제를 해결하는 방법을 잘 모르겠어요 :
void register_rename (int (*function) (const char *current, const char *new));
/*------------------------------------------------------------*/
/* WHEN: The callback is called once each time a file is received and
* accepted. (Renames the temporary file to its permanent name)
* WHAT: Renames a file from the given current name to the specified new name.
*/
그러나, 나는 다음과 같은 오류가 발생합니다. 동일한 헤더 파일에 선언 된 다른 유사한 콜백 루틴이 있는데이 오류가 발생하지 않습니다.
도와주세요! :)
구문 강조는 또한 typedef입니다 당신이 경우 코딩이 쉽게 찾을 수 있습니다 여기에 유용한 힌트 ... – ephemient
을 제공합니다 함수 포인터 :'typedef int (* fn) (const char *, const char * newStr); void register_rename (fn); ' –
또한 void register_rename (int (*) (const char *, const char *));는 동등한 프로토 타입입니다. 이름은 필요하지 않습니다. – ephemient