当前位置:网站首页>Stack growth direction and memory growth direction
Stack growth direction and memory growth direction
2022-06-21 17:25:00 【Soy sauce;】
1. The growth direction of the stack
Stack growth from high to low


2. Memory growth direction
Small end alignment : The low byte is placed at the low address , The high byte is placed at the high address ( many )
Big end alignment : Put the high byte in the low address , Put the low byte in the high address ( The server )
Sample code :
//1. The growth direction of the stack void test01(){ int a = 10; int b = 20; int c = 30; int d = 40; printf("a = %d\n", &a); printf("b = %d\n", &b); printf("c = %d\n", &c); printf("d = %d\n", &d); //a The address of is greater than b The address of , Therefore, the growth direction is downward } //2. Memory growth direction ( The small end model ) void test02(){ // High byte -> Status byte int num = 0xaabbccdd; unsigned char* p = # // The first byte from the first address printf("%x\n",*p); printf("%x\n", *(p + 1)); printf("%x\n", *(p + 2)); printf("%x\n", *(p + 3)); } |
边栏推荐
- 容器云是什么意思?与堡垒机有什么区别?
- Yaml file details
- 【毕业N年系列】 毕业第四年
- Unittest框架
- [SQLite] résoudre le jeton non enregistré: ''
- Function call model
- Move Protocol Beta测试版稳定,临时决定奖池规模再扩大
- 南京大学 静态软件分析(static program analyzes)-- introduction 学习笔记
- Use picgo core and Alibaba cloud to automatically upload typera pictures
- Simple ideas and procedures for quick sorting
猜你喜欢

Notice on the third national operation research / data, model and decision-making course teaching seminar in 2022

Test log of unittest framework

Qt 知识:使用 QGraphicsPixmapItem类

Unittest framework

Pytest framework implements pre post processing

Alibaba cloud server + pagoda panel + no domain name deployment web project

牛客网:验证IP地址

Garbage collector

Pytest framework

Overseas new things | zoovu, an American AI startup, raised a new round of financing of US $169million to optimize the online "product discovery" experience for consumers
随机推荐
【mysql学习笔记11】排序查询
Serialization and deserialization of binary tree
Nanjing University static program analyses -- Introduction learning notes
Machine learning model monitoring (Apria)
QT5知识:字符串列表QStringListModel
建立自己的网站(11)
[SQLite] solve unrecognized token:“‘“
容器云是什么意思?与堡垒机有什么区别?
剑指 Offer II 089. 房屋偷盗 / 剑指 Offer II 090. 环形房屋偷盗
今年的 618 不行了?
Résolution des erreurs signalées par qtcreator
Fidder tool usage notes
二叉树的序列化与反序列化
自然科学的根本任务
Generating test reports using the unittest framework
力扣解法汇总1108-IP 地址无效化
Force deduction solution summary 1108-ip address invalidation
Interface automatic encryption and decryption
二叉树的层序遍历
3M互助智能合约系统开发搭建技术