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(
相關文章
相關標籤/搜索