#include <iostream>
using namespace std;
size_t foo();
int main()
{
for (size_t ix = 0; ix != 5; ++ix)
cout << foo() << " times called." << endl;
return 0;
}
size_t foo()
{
static size_t counter = 0;
return ++counter;
}
local static object demo
最新推荐文章于 2024-05-22 10:27:57 发布