fork download
  1. #include<iostream>
  2. #include<sys/ipc.h>
  3. #include<sys/shm.h>
  4. #include <stdio.h>
  5. #include <unistd.h>
  6. #include<stdlib.h>
  7. using namespace std;
  8. #include <sys/types.h>
  9. #include <sys/wait.h>
  10.  
  11. int main() {
  12. fork();
  13. fork();
  14. cout << "Hello, world" << endl;
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0.01s 5292KB
stdin
Standard input is empty
stdout
Hello, world
Hello, world
Hello, world