Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: static CFSTR in C



On 28/08/2003 00:23, "Pietrzak, Bryan" <email@hidden> wrote:

> Doesn't this work?
>
> In "globals.cp"
>
> static CFStringRef gSomething = CFSTR("Something");
>
> In globals.h
>
> extern CFStringRef gSomething;

This one will not work (link) even in C++.

> Note that a CFStringRef is implicitly const -- it's not a CFMutableStringRef

This is different type of "constness".

const CFStringRef foo = ...;
...
foo = something else; // compile error

---

CFStringRef foo = ...;
...
foo = something else; // ok

Mike
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.