fork download
  1. int main()
  2. {
  3. // 1
  4. int& x1[5];
  5.  
  6. // 2
  7. int * x2;
  8.  
  9. // 3
  10. int *x3, *x4;
  11. auto dx = x3 - x4;
  12.  
  13. // 4
  14. int *x5 = x3*5;
  15.  
  16. // 5
  17. auto x6 = x3 + x4;
  18.  
  19. // 6
  20. int& z;
  21.  
  22. // 7
  23. auto y = &z;
  24. }
  25.  
  26.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:4:12: error: 'x1' declared as array of references of type 'int &'
    int& x1[5];
           ^
prog.cpp:11:5: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
    auto dx = x3 - x4;
    ^
prog.cpp:14:17: error: invalid operands to binary expression ('int *' and 'int')
    int *x5 = x3*5;
              ~~^~
prog.cpp:17:5: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
    auto x6 = x3 + x4;
    ^
prog.cpp:17:18: error: invalid operands to binary expression ('int *' and 'int *')
    auto x6 = x3 + x4;
              ~~ ^ ~~
prog.cpp:20:10: error: declaration of reference variable 'z' requires an initializer
    int& z;
         ^
prog.cpp:23:5: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
    auto y = &z;
    ^
3 warnings and 4 errors generated.
stdout
Standard output is empty