Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2613783
  • 博文数量: 877
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 5921
  • 用 户 组: 普通用户
  • 注册时间: 2013-12-05 12:25
个人简介

技术的乐趣在于分享,欢迎多多交流,多多沟通。

文章分类

全部博文(877)

文章存档

2021年(2)

2016年(20)

2015年(471)

2014年(358)

2013年(26)

分类: LINUX

2014-07-24 16:58:57

//变量外部链接和
#include 

void show(void);
int var_i = 1;

int main(void)
{
 //extern int var_i;
 // int var_i;
 var_i++;
 show();
 printf("The resule is %d\n",var_i);
 show();
 //printf("Num is : %d\n",var_show);


 return 0;
}

void show(void)
{
 static int var_show = 34;
 printf("This is just test for '%d'\n",++var_show);
}

 
///////////////////////////////////////////////////////////////////
/* loc_stat.c -- using a local static variable */
#include 
void trystat(void);

int main(void)
{
 int count;

 for (count = 1; count <= 3; count++)
 {
 printf("Here comes iteration %d:\n", count);
 trystat();
 }
 
 return 0;
}

void trystat(void)
{
 int fade = 1;
 static int stay = 1;

 printf("fade = %d and stay = %d\n", fade++, stay++);
}


                                   
阅读(553) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~