#include #include #include struct targ { int a,b,c; }; void *fun(void *arg) { targ *a = (targ *)arg; a->c = a->a + a->b; return NULL; } int main() { pthread_t thr; targ t = {4,7,0}; int code = pthread_create(&thr, NULL, fun, &t); printf("t.c=%d\n", t.c); pthread_join(thr, NULL); printf("%d+%d=%d\n", t.a, t.b, t.c); }