Static in C/C++ means that the variable will keep its value across calls to the function.
ex:
func() {
static int x=0;
++x;
cout << x << endl;
}
main() {
func();
func();
func();
}
This will print:
1
2
3
*NOT*
1
1
1
Chat with our AI personalities