问题:最后输出的x,y,z不是传入的1,2,3 ,问题出在哪里?
代码如下:
typedef __iconflash {
int x;
int y;
int z;
} iconflash;
pthread__t thread;
iconflash if;
if.x = 1;
if.y = 2;
if.z = 3;
pthread(&thread,NULL,flashmethod,&if);
void flashmethod(void *data) {
iconflash *if = (iconflash *)data;
printf("ifx=%d,ify=%d,ifz=%d\n",if->x,if->y,if->z);
}