示例:
/*** @brief how about symbol-inner? show you here.* @author wen`xuanpei* @email 15873152445@163.com(query for any question here)*/
#define _CRT_SECURE_NO_WARNINGS//support c-library in Microsoft-Visual-Studio
#include <stdio.h>static int callTime;
static int max(int a, int b);int main(){printf("%d\n", max(10, 20) );printf("%d\n", max(30, 20) );printf("%d\n", max(30, 40) );printf("%d\n", max(50, 40) );printf("%d\n", callTime);getchar();return 0;
}static int max(int a, int b){++callTime;return a > b ? a : b;
}
1)编译运行
2)要点分析
1)static可以作用于全局变量,限制在本模块内使用
2)static可以作用于函数的定义与声明,限制在本模块内使用
尾声:
其它不明白的地方不用过于纠结,那只是在浪费时间。学得多了,回过头来看自然融会贯通。