fork download
  1. #include <string>
  2. #include <iostream>
  3. #include <thread>
  4.  
  5.  
  6. //using namespace std;
  7.  
  8. void task1(std::string msg)
  9. {
  10. std::cout << "task1 says: " << msg<<std::endl;
  11. }
  12.  
  13. int main()
  14. {
  15.  
  16. std::thread t1(task1, "Hello");
  17. t1.join();
  18.  
  19.  
  20. return 0;
  21. }
  22.  
Runtime error #stdin #stdout 0s 3028KB
stdin
Standard input is empty
stdout
Standard output is empty