Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
About Constant Variables
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Dan Pop, post: 2383647"] Whereever the implementation wants to. The compiler couldn't care less. It could allocate them together with ordinary variables, in a writable memory segment. If you change their value behind the compiler's back, you deserve *anything* you get. Furthermore, the automatically allocated ones may have their values computed at run time, so the compiler cannot allocate them in read only memory. If the value can be changed, they're usually called variables, whether Jack Klein likes it or not. Even the C standard calls them like this. OTOH, if the value cannot be changed, the term "constant variable" is the canonical example of an oxymoron. Unfortunately, the obvious name for them, "constants", does not really reflect their semantics in a C program, as they are (named) read-only objects, rather than genuine constants, i.e. they cannot be used in constant expressions. Dan [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
About Constant Variables
Top