文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>static 变量 怪状

static 变量 怪状

时间:2010-06-05  来源:sinodragon21

#include <stdio.h>
#include <stdlib.h>

void test()
{
    static int temp = 0;

    printf("temp = %d.\n", temp);

    temp ++;
    return;
}

int main()
{
    int i = 0;
    for(i=0; i<10; i++)
    {
        test();
    }
    system("PAUSE");
}


运行结果:
temp = 0.
temp = 1.
temp = 2.
temp = 3.
temp = 4.
temp = 5.
temp = 6.
temp = 7.
temp = 8.
temp = 9.
请按任意键继续. . .
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载