JavaScript is required

It Is legal to return local variables from a function which returns by reference.

A.
TRUE
B.
FALSE
Trả lời:

Đáp án đúng: B


Returning a local variable by reference in C++ is wrong because local variables are destroyed when the function exits. The returned reference would then point to invalid memory, leading to undefined behavior.

Câu hỏi liên quan