• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: const assignment issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: const assignment issue (From: Luigi Castelli <email@hidden>)

  • Prev by Date: Re: executable obfuscator?
  • Next by Date: Re: const assignment issue
  • Previous by thread: Re: const assignment issue
  • Next by thread: Re: const assignment issue
  • Index(es):
    • Date
    • Thread