Question: what is the difference between local static and global static?
Answer: Local static variable is a variable defined in a block and is accessible locally only inside that block but due to static in nature, the value is persistent. Global static variable is a variable defined outside of any blocks and is accessible in all blocks in the same file where it is defined & is persistent.