通过 void *handel传到参数
通过 void *handel传到参数
typedef struct { int a; uchar *ptr; }EffectParam; void fun(void* handle) { //if (handle != NULL) //{ // cout << "handle " << handle << endl; //} EffectParam *param = (EffectParam*)handle; cout << param->a << endl; if (param->ptr != NULL) { cout << "param->ptr " << param->ptr << endl; } } void funtest() { EffectParam param; param.a = 3; param.ptr = new uchar[3]; void* handel = ¶m; fun(handel); } int main() { funtest(); return 0; }