Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Reference with constant modifier

$
0
0
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

Viewing all articles
Browse latest Browse all 51036

Trending Articles