extern和static在C语言里面的作用这里就不做过多的阐述了,下面直接通过一个小程序来看一看他们修饰的变量的特性。
#include <stdio.h>int count 3;int main()
{int i 0, count 2, sum 0;for (i 0; i < count; i 2, count){static int count 4;cou…
《函数值的交换》
交换函数的几种方式:
(1)
//error
int Swap1(int a,int b)
{
int tmp;
tmp a;
a b;
b tmp;
return 0;
} 在函数Swap1中,a和b的地址的值并没有交换。只是把10和20赋给了a和b,a和b原本的值并没有改变。
(2)
#…