#include <pthread.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <errno.h>struct student{
char *s ;
char *s1;
int age;
};
void * thr_fun(void *stu)
{   
sleep(1);
printf
("frist is %s,second is %s , thrid is %d\n",( (struct student*)stu )->s,( (struct student *)stu )->s1 ,( (struct student*)stu )->age);                                  

return(void *)0;}int main (int argc,char *argv[])
{   int err;
int i;
int *rval;
pthread_t nid;
struct student stu;

stu.s1="new thread ";
stu.s="main thread ";
stu.age = 20;
err = pthread_create(&nid,NULL,thr_fun,(void *)(&stu)); 
if(err != 0){
printf("new thread creat fail\n");
return -1;
}

for(i=0 ;i<argc ;i++){
   printf("main thread args is %s\n",argv[i]);
}
// sleep(1);  
pthread_exit(rval);//   problem!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// return 0;

}
当调用pthread_exit()函数 代替sleep()函数时  并且把 结构体里 char s[20]; char  s1[20]; 用char *s ,*s1字符串指针代替时
总有s1 会变成 NULL . 
拜托 大家看看  说说  谢谢!