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++
HOWTO: const and pointer variants in C and C++
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="James Kanze, post: 3674851"] It's generally true of top-level const. Something like: int const i = 42 ; , for example. The compiler knows that regardless of what happens elsewhere in a legal program, i will always be equal to 42. In C, probably, since such variables can't be used in constant expressions. In C++, it's actually quite common. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
HOWTO: const and pointer variants in C and C++
Top