动态储存与静态储存

 

//本代码不可运行代码 
#include<cstdio>
int main(){
    auto//自动的 
    static//静态的 
    register//寄存器的 
    extern//外部的--(声明) 
    return 0;
}
/*
静态变量求n的阶乘 
#include<iostream>
using namespace std;
int f(int x){
    static int to=1;
    to*=x;
    return to;
}
int main(){
    int n;cin>>n;
    for(int i=1;i<n;i++) f(i);
    cout<<f(n)<<endl;
    return 0;
} 
*/

 

posted @ 2016-06-27 15:50  神犇(shenben)  阅读(185)  评论(0编辑  收藏  举报