#include <iostream> int main() { int arr[5]={1,2,3,4,5}; const int (&)ref=arr[5]; for(int i=0;i<5;i++) std::cout<<ref[i]<<" "; std::cout<<"\n"<<std::endl; return 0; }
Standard input is empty
prog.cpp: In function ‘int main()’: prog.cpp:5:1: error: expected primary-expression before ‘const’ const int (&)ref=arr[5]; ^~~~~ prog.cpp:7:12: error: ‘ref’ was not declared in this scope std::cout<<ref[i]<<" "; ^~~
Standard output is empty