fork download
  1. #include <stdio.h>
  2. #include <pthread.h>
  3.  
  4. void *hello (void * arg) {
  5. printf(" hello ");
  6. }
  7.  
  8. void *world (void * arg) {
  9. printf(" world ");
  10. }
  11.  
  12. int main() {
  13.  
  14. pthread_t h, w;
  15.  
  16. pthread_create (&h, NULL, hello, NULL );
  17.  
  18. pthread_create (&w, NULL, world, NULL);
  19.  
  20. pthread_join(w, NULL);
  21.  
  22. return 0;
  23.  
  24. }
Success #stdin #stdout 0s 4536KB
stdin
Standard input is empty
stdout
 world