double & val = 66.6; //illegal
const double & val = 66.6; //legal
I was just doing some demo programs and came through the above concept but not able to identify what exactly the need of the above concept . what magic exactly const is doing in the second case ?
can anyone please let me know where exactly we can use this concept in real time programming