fork download
  1. #include <Windows.h>
  2. #include <cstdio>
  3.  
  4. struct Arith
  5. {
  6. void arithmetic()
  7. {
  8. std::printf("unko\n");
  9. }
  10.  
  11. static DWORD __stdcall thread_entry_point(VOID *param)
  12. {
  13. auto *pa = static_cast<Arith *>(param);
  14. pa->arithmetic();
  15.  
  16. return 0;
  17. }
  18. };
  19.  
  20. int main()
  21. {
  22. auto *pa = new Arith;
  23. DWORD tid;
  24. auto h = ::CreateThread(nullptr, 0, Arith::thread_entry_point, pa, 0, &tid);
  25. if ( h == nullptr )
  26. throw "oops...";
  27. std::printf("[main] started\n");
  28. ::WaitForSingleObject(h, INFINITE);
  29. std::printf("[main] joined\n");
  30. }
  31.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:21: fatal error: Windows.h: No such file or directory
compilation terminated.
stdout
Standard output is empty