site_archiver@lists.apple.com Delivered-To: cocoa-dev@lists.apple.com int CAPersonSwitchKey = 0; Solved which problem? Making your code compile or making it work? Consider: main.m: static int bobO = 42; int main (int argc, const char * argv[]) { printf("bobO: %d\n", bobO); doFred(); bobO = 43; printf("bobO: %d\n", bobO); doFred(); return 0; } fred.h: extern void doFred(); fred.c: static int bobO = 42; extern void doFred() { printf("fred: %d\n", bobO); } When run, this spews: bobO: 42 fred: 42 bobO: 43 fred: 42 b.bum _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/site_archiver%40lists.apple... This email sent to site_archiver@lists.apple.com On Sep 30, 2008, at 11:21 AM, Claus Atzenbeck wrote: On Tue, 30 Sep 2008, Nick Zitzmann wrote: How have you declared CAPersonSwitchKey in the header file? Making this static solved the problem. Declaring CAPersonSwitchKey as 'static' in every source file is, at the least, a small waste of memory. In the worst case, it won't do what you want -- if you change CAPersonSwitchKey in a code path in one source file, the other source files that declare the same static will not see the new value. smime.p7s