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]<<" ";
^~~
prog.cpp:8:12: error: ‘endl’ was not declared in this scope
std::cout<<endl<<std::endl;
^~~~
prog.cpp:8:12: note: suggested alternative:
In file included from /usr/include/c++/6/iostream:39:0,
from prog.cpp:1:
/usr/include/c++/6/ostream:590:5: note: ‘std::endl’
endl(basic_ostream<_CharT, _Traits>& __os)
^~~~