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 1027851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:17:49+00:00 2026-05-16T12:17:49+00:00

EDITED BELOW FOR UPDATES!!! Thank you for the help, please by all means point

  • 0

EDITED BELOW FOR UPDATES!!!
Thank you for the help, please by all means point out ALL mistakes , I don’t care if it sounds rude or mean or whatever, emo junk. Just give it to me straight so I can understand what is going wrong.

Hi everyone!

I am a rookie C++ programmer trying to learn and gain some IRL exp for C++.

I am attempting the following inside my VC++ (vs2008) compiler:

typedef unsigned short USHORT;

class Grid  
{  
...
public:  
    Grid()  
    {  
        Tile[36]* tileList_ptr;
    }  
...
};

In essence, I want to put 36 tiles , slam them into an array nice and tidy on the heap for a 8×8 playfield that never changes in size. Like a chessboard. Refer to them with a pointer, and fiddle with them in the related cpp file if needed.

If you aren’t laughing by now at this attempt then I probably made a syntax error instead of major design flaw 😛

Any help would be much appreciated!

Thanks in advance

EDIT 24/08/2010 13:49 (Time of start)

My code is now as following example:

The Grid Header file Grid.h:

#include "Tile.h"

class Grid
{

//no more typedef used

public: 
    Tile grid[8][8];

private:    
    unsigned short selectedItemIndexValue;
public:
    Grid()
    {

        Initialize();       
    }
    ~Grid(){}

    void Update();
    void FinalizeMove(unsigned short index);
    void Draw();

private:
    void Initialize(); //Initializes members
};

The Grid.cpp file:

#include "stdafx.h"   
#include "Grid.h"   
//Not tile , that used to give me a class redefinition error

unsigned short selectedItemIndexValue;

//No more typedef used

void Grid::Update()
{
    //Respond to controller commands
}

void Grid::FinalizeMove(unsigned short index)
{

}

void Grid::Draw()
{

}

void Grid::Initialize()
{
    for(int i = 0; i < 4; i++)
    {
        Grid::grid[i] = new Tile::Tile(10,10);   // ATTEMPT AT FILLING ARRAY
    }
}

Tile.h file

class Tile
{       
public:

private:
    enum TileOccupation
    {
        EmptyTile = 0,
        WhiteSphere = 1,
        BlackSphere = 2
    };

    unsigned short horizontalDimensions;
    unsigned short verticalDimensions;

public:
    Tile(){}    
    ~Tile(){}

void Update();
void Draw();

};

Tile.cpp file:

#include "stdafx.h"
#include "Tile.h"

void Tile::Update()
{

}

void Tile::Draw()
{

}

The attempt at filling the array in Grid.cpp is returning via the compiler the following error message: “Error 1 error C2061: syntax error : identifier ‘{ctor}'”

MSDN helped me giving me this:

“Compiler Error C2061. The compiler found an identifier where it wasn’t expected. Make sure that identifier is declared before you use it.”

I have failed at analysing it’s meaning. What exactly have I done wrong here ? And what other problems are there to be found in my project? All help and comments will be much appreciated. Just assume I know 0% of C++

  • 1 1 Answer
  • 2 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-16T12:17:50+00:00Added an answer on May 16, 2026 at 12:17 pm

    @user428435. Three things:

    1. 8×8 is 64, not 36
    2. What kind of problems are you having? If a compilation error, what is the error? Often careful reading of the errors can help you solve your problems. If the code compiles and runs, what does it do that you don’t expect it to do?
    3. You probably meant

      Tile* tileList_ptr[36];

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

Sidebar

Related Questions

(EDITED) Hello, In the form below, the field for <div class=urlfield><input name=url type=url id=url
Edited: Look at comments below. Short version: Screen simply flashes when I try to
UPDATE: I've edited the code below to show what I was using when I
Edited at the request of commenters. I hope this is compliant. First post! Trying
Edited: I want to get the actual with of the document with JS. I
(Edited for clarification) My (non-OSGi) application build is in Gradle, and I am trying
EDITED I'm using Twitter Bootstrap and need to move navbar right( not float:right, but
Edited with a SSCCE and a workaround I want to programmatically change the location
Edited code - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @Cell;
// edited by Neil Butterworth to conserve vertical space #include <stdio.h> struct A; struct

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.