Inside a function, you can initialize a static variable using the static keyword.
I said “inside a function”, because global variables are static by default, so there’s no need to
add the keyword.
What’s a static variable? A static variable is initialized to 0 if no initial value is specified, and it retains the value across function calls.
#c #c# #c++ #programming-c