static具体解释
来源:互联网 发布:cygwin linux内核 编辑:程序博客网 时间:2024/06/05 06:34
static
修饰变量
全局变量—————改变了链接属性(由外到内)——-改变了作用域
局部变量—————改变了生命周期
修饰函数
—————改变了链接属性(由外到内)
**```eg:text.c #include<stdio.h> #include<add.h> int main() { int a=10; int b=20; int add=Add(a,b); printf("%d",add); return 0;} add.h int Add(int x ,int y)txt.c #include<add.h> { return x+y; }
comprehension
当以这样的代码去编译时是可以得到想要的结果,如果执行下面的代码就不会得到想要的结果:
**
eg:text.c
#include<stdio.h>
#include<add.h>
int main()
{
int a=10;
int b=20;
int add=Add(a,b);
printf("%d",add);
return 0;
}
add.h
static int Add(int x ,int y)
txt.c
#include<add.h>
{
return x+y;
}
static 只能作用在当前.c或.h文件中不会作用其他区域里。
阅读全文
0 0
- static具体解释
- 关于C语言static定义函数类型的具体解释
- 关于C语言static定义函数类型的具体解释
- 关于C语言static定义函数类型的具体解释
- htons函数具体解释
- htons函数具体解释
- htons函数具体解释
- htons函数具体解释
- json具体事例解释
- Doxygen具体语法解释
- htons函数具体解释
- mvc的具体解释
- 具体说明:Static,final,abstract
- 三金 的具体解释
- 0x80 的具体解释
- CGRectContainsPoint的具体用法解释
- Git diff (---和+++具体解释)
- hash算法的具体解释
- Go基础
- 简单背包问题(0032)
- Python 练习实例27
- 位操作入门
- Attribute "class" was already specified for element "bean".
- static具体解释
- python学习--对象类型(num,string,list,dict,tuple,file)
- [后缀平衡树][JZOJ4384]hashit
- C#委托、事件
- 课后作业之动物类
- EasyDSS流媒体解决方案之Windows服务安装
- 《ES6标准入门》:let 和 const 命令
- 文章标题 并行计算 -- OpenMP简介和计算实例 (计算pi)
- linux基础系统目录