C程序存储空间分布
来源:互联网 发布:2017年网络语 编辑:程序博客网 时间:2024/05/16 06:46
某实习笔试曾考程序的存储空间分布:
high addess
command argument
&environment variable
stack (grows down)
heap (grows up)
uninitail data
initial data
program (程序正文段)
low address
1.Program can be shared by multiple process.(多个进程共享,打开几个notepad,它们是共享同一份二进制代码的)
2.Initial data is the varible which must be initial explicitly.Such as int cnt = 100 ; which is declared out of any function.(必须显式初始化的数据)
3.Unitial data is the varible which will be initialed to 0 or null pointer by the core,such as int cnt; which is declared out of any function.
(系统默认在程序开始执行前进行初始化的数据,函数体内的变量是不会自动初始化的,函数体外会自动初始化为0或空指针,且做正确类型的赋值,则整数就赋值0,指针就赋值null,题外话:calloc()函数则不会做正确的赋值)
4.Heap grows up,used to allocate the space when the program running.(动态分配)
5. Stack grows down,auto variable and some temp variable are her.
(自动变量和函数调用的一些信息:返回地址、调用者环境信息等,需要说明的是,递归调用在每次对应自身是,会使用一个新的帧,各自不影响)
6.Command line argument just like : int main(int argc ,char * argv[] ) {return 0;}
And every program has a environment variables table.
(命令行参数和环境变量放在高地址,环境表是每个程序都用的,之前写CGI程序,就是通过环境变量来处理请求响应的)
- C程序存储空间分布
- C程序存储空间分布 c知识回顾第三天
- C程序存储空间布局
- C程序存储空间布局
- C程序的存储空间
- c程序存储空间布局
- C程序的存储空间
- C程序存储空间布局
- c程序存储空间布局
- C程序存储空间布局
- C程序的存储空间
- C程序的存储空间
- c程序的存储空间布局
- C程序的存储空间布局
- C 程序的存储空间布局
- C程序的存储空间布局
- C程序的存储空间布局
- c程序中存储空间布局
- B树、B-树、B+树、B*树都是什么
- 中文编码问题解决方法汇总
- 2011-07-28 —— 杂记 —— GPIO(2)中断服务例程(Self's)
- 管理理念:如何让员工服从管理
- 《博客园精华集》分类索引
- C程序存储空间分布
- Deal with Multiple Stocks - Google Finance API
- Microsoft SQL Server 相关知识(资料整理)
- HDU3529 Bomberman - Just Search!重复覆盖DLX
- 网盘搜索(AppFen.com):搜索网络上分享的资源
- 缓冲字节流和文件操作
- 网盘搜索(AppFen.com) – 方便易用的国内网盘搜索引擎
- mac os下配置环境变量
- javascript函数parseInt()使用中需要的注意点