C++/why const member, reference member can only be initialized not assigned
why const member, reference member can only be initialized not assigned?
I read a couple of books that tells this, but seems not one can explain why
The reason for reference should be initialized when they are created is aside from initialization you cannot change what object a reference variable points to.
Member specified as const cannot be changed by your program.A const variable will either receive its value by explicit initialization or hardware dependent means.