fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <pthread.h>
  4.  
  5. void func(void* arg)
  6. {
  7. int* deref = (int*)arg;
  8. printf("%d, %d\n", (int)deref[0], (int)deref[1]);
  9. pthread_exit(NULL);
  10. }
  11.  
  12. int main()
  13. {
  14. int a[2] = {100,999999};
  15. pthread_t thread1;
  16. pthread_create(&thread1, NULL, (void*)func, (void*)a);
  17. pthread_join(thread1, NULL);
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 79168KB
stdin
Standard input is empty
stdout
100, 999999