Obviously it depends on the language and even the implementation of it if the specification of the language leave this book. In general local variables are allocated in the stack and at the end of the scope of its use (it may not be the function, it may be a smaller scope) the space becomes free for use by other variables, in general a new call to a function. There’s no erasure of the value there, as far as I know in any technology unless somehow an object is created thinking about it.
Some languages may use heap even for local variables, or even another mechanism. Usually in this case need to have an automatic release mechanism of the variable because the variable should not hold an object more than its lifespan. Re-release does not mean erasing the data.
Note that a variable is not usually destroyed because this is a concept of its code, variables do not exist at runtime, exist objects that are in memory positions that in your code you referenced through an identifier that we call variable.
In C the behavior is actually a declared and uninitialized variable taking the value that was there, not necessarily from a previous variable, simply the existing value will be used every time it references the variable without a new explicit assignment. Outside C++ virtually no other language acts like this, in general the specification determines that the even not explicitly initialized value has its value zeroed by the compiler. Or you can ban a compile code if there is no explicit initialization. C is considered Portable Assembly and does not have this type of concern.
You can see more about memory consumption of variables in How to see how much memory occupies such a variable in C++? And how to use the define?.
No "destruction" occurs, memory space simply becomes available for new allocations. If a new allocation occurs and no initial value is assigned, the existing memory garbage will be used.
– anonimo
The garbage is the content of the variable that occupied that place of memory?
– Fabricio Paiva
What existed saved at the allocated memory position that may not match the allocation of a previously allocated variable in that region.
– anonimo