Question: what is the difference between a local variable a static variable and a global variable?
Answer: A local static variable is a variable that can maintain its value from one function call to another and it will exist until the program ends. ... A global static variable is one that can only be accessed in the file where it is created.