void*에 구조체를 넘기는 방법입니다.

#include <stdio.h>
                                                                                
typedef struct{
        int b;
}STRUCT_A;
                                                                                
void test_func(void  * d){
        int a;
        a = ((STRUCT_A*)d)->b;
        printf("");
}
void func(void  *c){
        printf("");
        test(c);
}
                                                                                
                                                                                
int main(void){
        STRUCT_A a;
                                                                                
        a.b = 7;
        func(&a);
                                                                                
        printf("");
        return 0;
}
lynn.baek's profile image

lynn.baek

2018-05-11 09:42

Read more posts by this author