static 以及变量声明和定义

#include <iostream> #include<string> #include<cstring> using namespace std; size_t count_calls() { static size_t ctr;//只声明未定义 执行默认初值 ctr=0; //赋值 return ++ctr; } int main() { for(
相关文章
相关标签/搜索