In C++, we can't declare a reference without initialization. What is the actual reason for this.Although we are aware about the uses of references in operator overloading and other concepts.
C++ references (in the ordinary C++ meaning of that word) can't be reassigned. So if a reference isn't initialized it can't be made to refer to anything. And the language does not support null-references, hence, an uninitialized reference, if such were permitted, would always be in error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With