What are local static variables? How can you use them?
A local static variable gets defined in a specific block and is accessible locally inside that block only. However, because it is static, its value is persistent. Its lifetime does not end when a function call is declared. Instead, its lifetime extends throughout the program. Local static variables can be used for counting the number of times a particular function is called.