when compiled with cc -pthread mt.c it compiles fine, but when executed, it does not print anything. Why ?Code:#include<stdio.h> #include<pthread.h> void *mt(void *b) { printf("\nReached here\n\n"); return b; } int main() { pthread_t i; int a; if(pthread_create(&i, NULL, &mt, (void *)&a)) printf("thread creation failed\n"); return 0; }
Bookmarks