Final answer:
The lifetime of a dynamically allocated variable lasts until it is explicitly freed by the programmer, and not when a function ends or a block scope ends.
Step-by-step explanation:
The lifetime of a dynamically allocated variable lasts until it is explicitly freed by the programmer. This means that option C, 'Until explicitly freed,' is the correct answer. Dynamically allocated memory remains allocated in a program until it is explicitly released using the appropriate function or mechanism provided by the programming language, such as 'free()' in C or 'delete' in C++. This memory does not automatically get deallocated when a function ends or a block scope ends, which differentiates it from automatic storage duration (stack allocation), where variables are automatically destroyed once the function or block scope in which they are defined ends.