In C++, a variable that has been defined but not initialized may not be use as an ______. (l-value or r-value).

In C++, a variable that has been defined but not initialized may not be use as an ______. (l-value or r-value).

Answer: r-value

Explanation: The value of an uninitialized variable may not be fetched. C++ does not enforce this. If an uninitialized variable’s value is fetched you get whatever value was left in the memory location by a previous user. Note that the value is garbage in the dictionary sense, It is not a random value.


Learn More :