首页 > 代码库 > static

static

#include<stdio.h>#include<iostream>#include<assert.h>using namespace std;static int a=100;void func(){    static int a=10;    a++;    cout<<a<<endl;}int main(){    for(int i=0; i<10; i++)        func();    a++;    cout<<a<<endl;}

 

#include<stdio.h>#include<iostream>#include<assert.h>using namespace std;static int a=100;void func(){    a++;}int main(){    a++;    cout<<a<<endl;}

 

static