摘要
1、内存的属性,2、只读空间介绍,3、数据段介绍 4、堆栈空间 mallo、free介绍。
一、内存的属性
1、大小;2、位置。
auto int a=0;//默认方式
编写了一个小程序,看一下变量a和主函数所存储的地址:
#include <stdio.h>
int main (void )
{
int a;
a =0xff;
printf ("the a's address is %p \n",&a);
printf ("the main's address is %p \n",main);
return 0;
}
运行程序后的结果如下图所示