Re: const assignment issue
Re: const assignment issue
- Subject: Re: const assignment issue
- From: Steve Sisak <email@hidden>
- Date: Fri, 8 Dec 2006 14:47:24 -0500
At 10:58 AM -0800 12/8/06, Luigi Castelli wrote:
Are C and C++ behaving differently in regards to
consts ?
Yes. In C:
const int foo = 6;
Declares an unmodifiable variable who's value is 6.
It is not a compile-time constant, however -- for instance, you can't
use it as a case in a switch statement either.
The ability to use the value of a const variable as a compile-time
constant is an enhancement added by C++. (Although many
implementations still access the variable at runtime rather treating
it as a #define)
HTH,
-Steve
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden