Question

    What happens to the memory allocated to a local variable when the function exits?

    A The memory is deallocated immediately. Correct Answer Incorrect Answer
    B The memory is deallocated when the program terminates. Correct Answer Incorrect Answer
    C The memory remains allocated until the program is restarted. Correct Answer Incorrect Answer
    D The memory is deallocated when the variable is reassigned. Correct Answer Incorrect Answer

    Solution

    The memory is deallocated immediately.

    Practice Next

    Relevant for Exams: