fork download
  1. #include<stdio.h>
  2. #include<pthread.h>
  3. void *fun(){
  4. for(int i=0;i<5;i++){
  5. printf("%d",i);
  6. }
  7. }
  8. int main(){
  9. pthread_t t;
  10. pthread_create(&t,NULL,fun,NULL);
  11. pthread_join(t,0);
  12. for(int i=20;i<25;i++){
  13. printf("%d ",i);
  14. }
  15. return 0;
  16. }
Success #stdin #stdout 0.01s 5304KB
stdin
Standard input is empty
stdout
0123420 21 22 23 24