int main() { // 1 int& x1[5]; // 2 int * x2; // 3 int *x3, *x4; auto dx = x3 - x4; // 4 int *x5 = x3*5; // 5 auto x6 = x3 + x4; // 6 int& z; // 7 auto y = &z; }
Standard input is empty
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.
Standard output is empty