#include<pthread.h>
#include<stdio.h>
int value=0;
void *runner(void *param);
int main(int argc,char *argv[])
{
int pid;
pthread_t tid;
pthread_attr_t attr;
pid=fork();
if(pid==0){
pthread_attr_init(&attr);
pthread_create(&tid,&attr,runner,NULL);
pthread_join(tid,NULL);
printf("CHILD VALUE=%d",value);
}
else if(pid>0){
wait(NULL);
printf("PARENT VALUE=%d",value);
}
}
void *runner(void *param){
value=5;
pthread_exit(0);
}
what is the value of child and parent?? will the child and the thread created by it share the data? so output will be 5 and 0?