#include<stdio.h>
#include<stdlib.h>
int g_val = 100;//全局变量
void test()
{
int a = 10;
int b = 10;
printf("test stack1 address:0x%x\n", &a);
printf("test stack1 address:0x%x\n", &b);
}
void(*fp)();
int main()
{
int a = 10;
int *heap = (int*)malloc(sizeof(int));//堆中数据
fp = test;
printf("code address:0x%x\n", fp);//fp为函数指针,指向test函数--代码段
printf("data address:0x%x\n", &g_val);//数据段
printf("heap address:0x%x\n", heap);//堆
printf("main statc0 address:0x%x\n", &a);//主函数
fp();
system("pause");
return 0;
}