What happens to a local variable when the function in which it is defined finishes executing?
- It becomes a global variable
- It remains in memory
- It's accessible from other functions
- It's automatically freed
When a function finishes executing, the local variables defined inside it are automatically freed, and their memory is reclaimed. They do not persist after the function call.
Loading...
Related Quiz
- The members of a structure are accessed using the ________ operator.
- When an array of strings is declared in C, what is it essentially an array of?
- Consider a scenario where a program needs to store a character read from a file. Which data type would be appropriate for this?
- In C, the ________ function is used to copy a specified number of characters from one string to another.
- You're developing a function that modifies an array of integers. To ensure that the original array is not altered, how should the array be passed to the function?