- #include <stdio.h>
-
#include <stdlib.h>
-
-
int quanju;/*未初始化全局变量 bss*/ //0x804a028
-
-
void fun(int f_jubu); /*程序代码区text*/
-
void *fun1(); /*程序代码区text*/
-
-
int main(void)/**/
-
-
{
-
-
int m_jubu;/*栈区(stack)*/// 0xbfd8d78c
-
-
static int m_jingtai;/*rodata 常量区*///0x804a024
-
-
//0x80485e0 //0xbfd8d784
-
char *m_zifum,*m_zifuc = "hello";/*指针本身位于栈。指向字符串"hello",位于文字常量区*/
-
-
void (*pfun)(int); /*栈区(stack)*/ //0x80484ee //0xbfd8d780
-
-
pfun=&fun;
-
//0x8b44008
-
//0xbfd8d788
-
m_zifum = (char *)malloc(sizeof(char)*10);/*指针内容指向分配空间,位于堆区(heap)*/
-
-
pfun(1);
-
-
printf("&quanju : %p\n",&quanju);//0x804a028
-
-
-
printf("&m_jubu : %p\n",&m_jubu);// 0xbfd8d78c
-
-
printf("&m_jingtai: %p\n",&m_jingtai); //0x804a024
-
-
printf("m_zifuc : %p\n",m_zifuc); //0x80485e0
-
-
printf("&m_zifuc : %p\n",&m_zifuc);//0xbfd8d784
-
-
printf("m_zifum : %p\n",m_zifum);//0x8b44008
-
-
printf("&m_zifum : %p\n",&m_zifum);//0xbfd8d788
-
-
printf("pfun : %p\n",pfun);//0x80484ee
-
-
printf("&pfun : %p\n",&pfun);//0xbfd8d780
-
-
fun1();
-
printf("*fun1() :%p\n",&fun1); //代码
-
-
printf("*fun1() :%p\n",fun1);
-
-
// getch();
-
-
return 0;
-
-
}
-
-
void fun(int f_jubu)
-
-
{
-
-
static int f_jingtai;
-
-
printf("&f_jingtai: %p\n",&f_jingtai); //0x804a020
-
-
printf("&f_jubu : %p\n",&f_jubu); // 0xbfd8d770
-
/*栈区(stack),但是与主函数中m_jubu位于不同的栈*/
-
-
}
-
-
void *fun1()
-
{
-
static int f_fun1 = 1;
-
printf("&f_fun = %p\n",&f_fun1);
-
}
资料
http://blog.csdn.net/cuibo1123/archive/2008/06/14/2547442.aspx
阅读(410) | 评论(0) | 转发(0) |