Am new to C, am trying to create thread using below code but i unable to create thread, Can any one tell me where i am going wrong... It is not going into 'if' loop and not calling 'myfunction'
void *myfunction() {
//my code
}
void createThreadForMyFunction(void) {
pthread_t thread_ID;
if(pthread_create(&thread_ID, NULL, myfunction, NULL)) {
printf("pthread_create");
}
}