#include <iostream>
#include <threads.h>
using namespace std;
struct temp{
int num;
int age;
};
temp t1;
void *display(void * arg)
{
temp *t = (temp*)arg;
t->age=18;
t->num=100;
cout<<"this is a son thread:"<<pthread_self()<<endl;
return t;
}
int main() {
pthread_t pid;
cout<<"this is a father thread"<<pthread_self()<<endl;
void *t2;
pthread_create(&pid,NULL,display,&t1);
pthread_join(pid,&t2);
temp *t = (temp*)t2;
cout<<t->age<<endl<<t->num<<endl;
}