call back 함수?
글쓴이: 하하 / 작성시간: 수, 2003/11/26 - 10:56오전
int p_create(void *(*test_call_back)(void *));
void *func() {
printf(" hahahahaha \n");
}
main()
{
p_create(func);
}
int p_create(void *(*CALLBACK)(void *)) {
CALLBACK();
}
m1.c: In function `p_create':
m1.c:24: too few arguments to function
이렇게 나오는 이유는 무엇인지.. 알고 싶습니다.
그럼.. 즐거운 하루 되세요.. ^____^;;
Forums:


[quote][code:1]int p_create(void *&#
CALLBACK함수 definition이 parameter가 void * 인데
호출 시점에 argument를 넘겨주지지 않네요..
int p_create(void *(*CALLBACK)(void *)) { CALLBACK(NULL); }이렇게 하거나argmuent 넘결려고 하면
int p_create(void *arg, void *(*CALLBACK)(void *)) { CALLBACK(arg); } main() { p_create("bloc bloc", func); }댓글 달기