I was just wondering why ancient compilers like Turbo c++ 3.0(Blue screen IDE) & Borland Turbo C++ 4.5 etc doesn't report any error in following program.
#include <iostream.h>
int main()
{
int& a=10;
cout<<a;
return 0;
}
The above program won't be accepted by modern C++ compilers, But why then ancient compilers allows this? They simply shows single warning in above program.
const
reference, which is valid today in C++. This question is only about non-const
references. – Armourint
, works withstruct S {};
.) There's a Level 4 warning issues when you do this. – Gaylor