#include "stdio.h"
#include "stdlib.h"
int g_unval;
int g_val = 100;
int main(int argc, char* argv[], char* env[]) {
printf("code addr :%p\n", main);
const char *p = "hello bit!";
printf("read only : %p\n", p);
printf("global val : %p\n", &g_val);
printf("global uninit val : %p\n", &g_unval);
char *q = (char *)malloc(10);
printf("heap addr : %p\n", q);
int a = 0;
int b = 0;
int c = 0;
printf("stack addr : %p\n", &p);
printf("stack addr : %p\n", &q);
printf("stack addr : %p\n", &a);
printf("stack addr : %p\n", &b);
printf("stack addr : %p\n", &c);
printf("args addr : %p\n", argv[0]);
printf("args addr : %p\n", argv[argc-1]);
printf("env addr : %p\n", env[0]);
return 0;
}
【Linux学习笔记】探究虚拟空间分布
最新推荐文章于 2024-11-03 12:02:27 发布