Static Variables: Variables in a function, Variables in a class Static Members of Class: Class objects and Functions in a class. Let us now look at each one of these uses of static in detail. Static Variables. Static variables in a Function: When a variable is declared as static, space for it gets allocated for the lifetime of the program.Even if the function is called multiple …