Question: what is the difference between a static local variable and a global variable?
Answer: Global variables are variables which are defined outside the function. ... ﻿Static local variables: Variables declared as static inside a function are statically allocated, thereby keeping their memory cell throughout all program execution, while also having the same scope of visibility as automatic local variables.