E
emanuela
Hi,
I've a little question about C language:
according to the pthread_create signature:
int pthread_create(pthread_t *thread,
const pthread_attr_t *attr,
void *(*start_routine)(void*),
void *arg);
which syntax is more correct?
1) void* function (void* args) {...}
main()
{ ...
pthread_create(&mythread, NULL, function, NULL)
...
}
2) void* function (void* args) {...}
main()
{ ...
pthread_create(&mythread, NULL, &function, NULL)
...
}
According to me, only the second one is correct
but I succeed in compiling both of them (gcc - Linux Fedora Core 1 (2.4.))
Why?
Thanks
Emanuela
I've a little question about C language:
according to the pthread_create signature:
int pthread_create(pthread_t *thread,
const pthread_attr_t *attr,
void *(*start_routine)(void*),
void *arg);
which syntax is more correct?
1) void* function (void* args) {...}
main()
{ ...
pthread_create(&mythread, NULL, function, NULL)
...
}
2) void* function (void* args) {...}
main()
{ ...
pthread_create(&mythread, NULL, &function, NULL)
...
}
According to me, only the second one is correct
but I succeed in compiling both of them (gcc - Linux Fedora Core 1 (2.4.))
Why?
Thanks
Emanuela