凡被保存在C常数变量? [英] Where are constant variables stored in C?

查看:74
本文介绍了凡被保存在C常数变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道在那里不断的变量存储。在相同的存储区域为全局变量?或在堆栈上?

I wonder where constant variables are stored. In the same memory area as global variables? Or on the stack?

推荐答案

他们是如何保存是一个实现细节(依赖于编译器)。

How they are stored is an implementation detail (depends on the compiler).

例如,在GCC编译器,在大多数机器上,只读变量,​​常量和跳转表被放置在文本部分。

For example, in the GCC compiler, on most machines, read-only variables, constants, and jump tables are placed in the text section.

这篇关于凡被保存在C常数变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆