An Array of structs
An Array of structs
- Subject: An Array of structs
- From: John Love <email@hidden>
- Date: Fri, 27 Nov 2009 06:35:51 -0500
In my .h file, I have:
typedef struct YearAmt {
NSString *year;
int amount;
} YearAmt;
extern NSString *testy;
extern YearAmt gTest[];
In the corresponding .m file:
NSString *testy = @"testy";
YearAmt gTest[] = {{testy, 10} /*, + others */};
I get "Initializer element is not constant. This pertains to the NSString* because if I directly substitute the following, no compile error happens:
YearAmt gTest[] = {{@"testy", 10}
What fundamental pertaining to C or C++ am I not getting?
John Love
Touch the Future! Teach!
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden