fork(1) download
  1. #include <iostream>
  2. #include <unistd.h>
  3. #include <sys/types.h>
  4.  
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10. cout<<"*\n";
  11. fork();
  12. cout<<"A\n";
  13. fork();
  14. cout<<"B\n";
  15. fork();
  16. cout<<"C\n";
  17. return 0;
  18. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
*
A
B
C
*
A
B
C