最近老是有人问些编程的问题啊,呵呵
void func(void* p);
int main(int argc,char** argv){
int a=0;
func((void*)&a);
printf("%d\n",a);
return 0;
}
void func(void* p){
*(int*)p = 1;
return;
}
2009/11/18 刘小林 <ziyu...@gmail.com>

> 各位,小弟有一问:如何在自己定义的函数中以void类型的指针作形参,并且还要在该函数中操作传入的参数。
> 例如,假设有如下代码段:
>
> -----------------------------
> void test (void * p)
> {
>    //一些包括对传入参数的操作,比如,得到传入的值。
> }
> -----------------------------
>
> >
>


-- 
google一哈,你就晓得

--~--~---------~--~----~------------~-------~--~----~
 要向邮件组发送邮件,请发到 ph4nt0m@googlegroups.com
 要退订此邮件,请发邮件至 ph4nt0m-unsubscr...@googlegroups.com
-~----------~----~----~----~------~----~------~--~---

回复