fork download
  1. #include <intrin.h>
  2.  
  3. using namespace System;
  4.  
  5. struct result
  6. {
  7. UInt32 eax;
  8. UInt32 ecx;
  9. UInt32 edx;
  10. UInt32 ebx;
  11. };
  12.  
  13. result cpuid(UInt32 function, UInt32 ecx = 0)
  14. {
  15. int out[4];
  16.  
  17. __cpuidex(out, function, ecx);
  18.  
  19. result r;
  20.  
  21. r.eax = out[0];
  22. r.ebx = out[1];
  23. r.ecx = out[2];
  24. r.edx = out[3];
  25.  
  26. return r;
  27. }
  28.  
  29. void print_cpu(result r)
  30. {
  31. for (Int32 i = 0; i < 4; i++)
  32. {
  33. Console::Write((Char)((r.eax >> (i * 8)) & 0xff));
  34. }
  35.  
  36. for (Int32 i = 0; i < 4; i++)
  37. {
  38. Console::Write((Char)((r.ebx >> (i * 8)) & 0xff));
  39. }
  40.  
  41. for (Int32 i = 0; i < 4; i++)
  42. {
  43. Console::Write((Char)((r.ecx >> (i * 8)) & 0xff));
  44. }
  45.  
  46. for (Int32 i = 0; i < 4; i++)
  47. {
  48. Console::Write((Char)((r.edx >> (i * 8)) & 0xff));
  49. }
  50. }
  51.  
  52. int main(array<System::String ^> ^args)
  53. {
  54. print_cpu(cpuid(0x80000002));
  55. print_cpu(cpuid(0x80000003));
  56. print_cpu(cpuid(0x80000004));
  57.  
  58. Console::ReadLine();
  59.  
  60. return 0;
  61. }
  62.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:20: error: intrin.h: No such file or directory
prog.cpp:3: error: ‘System’ is not a namespace-name
prog.cpp:3: error: expected namespace-name before ‘;’ token
prog.cpp:7: error: ‘UInt32’ does not name a type
prog.cpp:8: error: ‘UInt32’ does not name a type
prog.cpp:9: error: ‘UInt32’ does not name a type
prog.cpp:10: error: ‘UInt32’ does not name a type
prog.cpp:13: error: ‘UInt32’ was not declared in this scope
prog.cpp:13: error: ‘UInt32’ was not declared in this scope
prog.cpp:14: error: expected ‘,’ or ‘;’ before ‘{’ token
prog.cpp: In function ‘void print_cpu(result)’:
prog.cpp:31: error: ‘Int32’ was not declared in this scope
prog.cpp:31: error: expected `;' before ‘i’
prog.cpp:31: error: ‘i’ was not declared in this scope
prog.cpp:33: error: ‘Console’ has not been declared
prog.cpp:33: error: ‘Char’ was not declared in this scope
prog.cpp:33: error: ‘struct result’ has no member named ‘eax’
prog.cpp:36: error: expected `;' before ‘i’
prog.cpp:36: error: ‘i’ was not declared in this scope
prog.cpp:38: error: ‘Console’ has not been declared
prog.cpp:38: error: ‘Char’ was not declared in this scope
prog.cpp:38: error: ‘struct result’ has no member named ‘ebx’
prog.cpp:41: error: expected `;' before ‘i’
prog.cpp:41: error: ‘i’ was not declared in this scope
prog.cpp:43: error: ‘Console’ has not been declared
prog.cpp:43: error: ‘Char’ was not declared in this scope
prog.cpp:43: error: ‘struct result’ has no member named ‘ecx’
prog.cpp:46: error: expected `;' before ‘i’
prog.cpp:46: error: ‘i’ was not declared in this scope
prog.cpp:48: error: ‘Console’ has not been declared
prog.cpp:48: error: ‘Char’ was not declared in this scope
prog.cpp:48: error: ‘struct result’ has no member named ‘edx’
prog.cpp: At global scope:
prog.cpp:52: error: ‘array’ was not declared in this scope
prog.cpp:52: error: ‘System’ has not been declared
prog.cpp:52: error: expected primary-expression before ‘>’ token
prog.cpp:52: error: expected primary-expression before ‘^’ token
prog.cpp:52: error: ‘args’ was not declared in this scope
prog.cpp:53: error: expected ‘,’ or ‘;’ before ‘{’ token
stdout
Standard output is empty