Subj : Re: trying to learn pthreads To : comp.programming.threads From : Eric Sosman Date : Fri Mar 18 2005 01:38 pm Beau Elliott wrote: > [...] > When I run the program, it prompts for the value to be read in, however > I get a segmentation fault afterwards...can anyone tell me why? You've got a C error, not a threading problem. > #include > #include > > struct tdata{ > > int level; > int left[2]; > int right[2]; > }; > > void *test(void *data){ > > tdata *temp; > temp = (struct tdata *)data; > > //printf("%d", temp->level); > > printf("Please type in an integer: "); > scanf("%d", temp->level); scanf("%d", &temp->level); -- Eric.Sosman@sun.com .