nazerke
11/27/2019 - 1:50 PM

static

#include <cstdio>
using namespace std;

void func()
{
  static int i = 5;
  printf("i is %d\n", ++i);
}
int main()
{
    func();// i is 6
    func();// i is 7
    func();// i is 8
    return 0;
}