Memory Segments in C — Text Segment

我们两清 提交于 2019-12-01 12:04:39

问题


Can someone tell me what is a 'text segment' in C, and if possible show me a simple example?


回答1:


The 'text' segment of a program on Unix systems is the code — the machine code, the functions that make up the program (including, in particular, main() if the program is written in C or C++). It can also include read-only data. The other segments in a classic program are the 'data' segment and the 'bss' segment. The 'data' segment holds initialized data; the 'bss' segment holds zeroed data. Once running, the data and bss segments are indistinguishable.

You also end up with the stack and 'the heap'.



来源:https://stackoverflow.com/questions/21315308/memory-segments-in-c-text-segment

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!