At global scope, right?
The "const" version cannot be changed to point to a separate
CFStringRef; the compiler prohibits you from writing:
kStringRef1 = CFSTR("another string"); // <-- illegal
The "static" version, unlike the "const" version, is not given global
linkage. It cannot be referenced from another file via extern, like so:
extern const CFStringRef sStringRef1; // <-- illegal
You can combine these properties to create a CFStringRef which cannot
be changed and does not have global linkage:
static const CFStringRef k_stringRef3 = CFSTR("local and unchanging
string");
In function scope, the meaning of "const" is the same, and "static"
is a little different. You can look it up in any C++ reference book
for details :)
On Nov 29, 2005, at 5:34 PM, Stevo Brock wrote:
What would be the difference between declaring CFStringRefs const
vs. static in a single source file? As in...
Is there any difference? Is there any difference if they are used
once or more than once in the file?
Curious...
-Stevo Brock
Monkey Tools
www.monkey-tools.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/carbon-dev/jstiles%
40blizzard.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden