Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 570155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:22:15+00:00 2026-05-13T13:22:15+00:00

my YYY.h file is #define W 1 // i am #define B 2 //

  • 0

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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:22:16+00:00Added an answer on May 13, 2026 at 1:22 pm

    I think you should write this in .m file

    static int 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}
        };
    

    and remove static int boardPos[12][12]; in .h, remove boardPos[12][12] = {
    … } in .m.

    This will make boardPos visiable only in this .m file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my XML file <employee> <name ref=a1 type=xxx></name> <name ref=a2 type=yyy></name> <name ref=a3
I have an XML file in a string in this format: <item> <name>xxx</name> <id>yyy</id>
My applet runs file when I call it from a static applet.html file, like
I'm trying to replace every multiline import inside a Python source file.. So, the
Say I have a subdomain xxx.yyy.com running Apache. The files are stored in /home/someone/public_html/xxx
I've this xml <root> <node1> <node2>xxx</node2> </node1> ... <node1> <node2>yyy ABC yyy</node2> </node1> ...
I have an ApplicationContext.xml file with the following node: <context:property-placeholder location=classpath:hibernate.properties, classpath:pathConfiguration.properties /> It
I have an application that reads times from a file. These times can be
This isn't a duplicate of VC++ resources in a static library because it didn't
i have a file of numbers like that : XXX are unknow numbers XXXX

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.