Tagged articles

Data Segments

1 articles · Page 1 of 1
Liangxu Linux
Liangxu Linux
Sep 2, 2023 · Fundamentals

Mastering C Memory Layout: Stacks, Heaps, Segments, and const Usage

This article explains the five memory partitions in C, the storage regions created during compilation and linking, the different program segments (code, RO data, RW data, BSS, heap, stack), the proper use of const and pointers, 8051-specific memory qualifiers, and a detailed comparison of stack and heap allocation, including practical code examples.

C ProgrammingData Segmentsconst
0 likes · 25 min read
Mastering C Memory Layout: Stacks, Heaps, Segments, and const Usage