Declaring and initialization of C array.
Declaring and initialization of C array.
- Subject: Declaring and initialization of C array.
- From: JAMES ROGERS <email@hidden>
- Date: Wed, 01 Jun 2011 10:12:32 -0500
K&R says to declare and initialize an array in C:
int myArray[2] = {1,2};
If the above is entered into the .h file of a cocoa project, the compile will fail with the following:
/Users/jimrogers_w4atk/Development/workspace/ArrayTest/ArrayTestAppDelegate.h:14:0 /Users/jimrogers_w4atk/Development/workspace/ArrayTest/ArrayTestAppDelegate.h:14: error: expected ':', ',', ';', '}' or '__attribute__' before '=' token
I would really like to use a simple C array as the example above. Any help would be appreciated.
JIM ROGERS
email@hidden
http://web.me.com/jimrogers_w4atk
_______________________________________________
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