传入的结构体指针强制转为实例化结构体*v

struct val *v = (struct val *)arg;//传入的结构体指针强制转为实例化结构体*v
struct val{
   int num1;
      int num2;
  };
void *text3(void *arg)
{
    struct val *v = (struct val *)arg;
int num3=v—>num1;
int num4=v->num2;
printf("arg is v.num1:%d,v.num2:%d\n",num3,num4); // printf("arg is v.num1:%d,v.num2:%d\n",v->num1,v->num2); pthread_exit(NULL);
}
例子:=======>>>>【C】——如何用线程进行参数的传递;
posted @ 2017-09-21 11:21  丁培飞  阅读(1254)  评论(0编辑  收藏  举报