hello!
my YYY.h file is
#define W 1 // i am
#define B 2 // opponent
#define F 3 // board margin
static int boardPos[12][12];
@interface YYY : NSObject
{...}
-(id)init;
@end
and YYY.m is
#import "YYY.h"
@implementation YYY
-(id)init
{
if (self = [super init]) {
// initializing Empty Board
boardPos[12][12] = {
{F,F,F,F,F,F,F,F,F,F,F,F},
{F,0,0,0,0,0,0,0,0,0,0,F},
{F,0,0,0,0,0,0,0,0,0,0,F},
{F,0,0,0,0,0,0,0,0,0,0,F},
{F,0,0,0,0,0,0,0,0,0,0,F},
{F,0,0,0,0,0,0,0,0,0,0,F},
{F,0,0,0,0,0,0,0,0,0,0,F},
{F,0,0,0,0,0,0,0,0,0,0,F},
{F,0,0,0,0,0,0,0,0,0,0,F},
{F,0,0,0,0,0,0,0,0,0,0,F},
{F,0,0,0,0,0,0,0,0,0,0,F},
{F,F,F,F,F,F,F,F,F,F,F,F}
};
...
I got error "Expected expression before { token in "boardPos[12][12] = {" string. If I write something before boardPos - it become local variable; So I cant initialize this C-array properly. I need boardPos be visible in class scope. I tried to put it in class declaration - same error.
Btw, I already rewrite it on NSArray objects but still interesting how to deal with C-arrays.
Thx!