fork download
  1. #include <iostream>
  2. #include <thread>
  3.  
  4. using namespace std;
  5.  
  6. void func(int t)
  7. {
  8. cout << t << endl;
  9. }
  10.  
  11. int main()
  12. {
  13. thread t1(func,4);
  14. t1.join();
  15. return 0;
  16. }
Success #stdin #stdout 0s 11656KB
stdin
Standard input is empty
stdout
4