Beginner C++ : Lesson 12 need help

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
RoyalMadBull
Posts: 3
Joined: April 29th, 2013, 11:49 am

Beginner C++ : Lesson 12 need help

Post by RoyalMadBull » April 29th, 2013, 11:57 am

I have started to follow Chili’s beginner programming tutorial and I got as far to lesson 12 before I got an error that I can’t fix and if someone could help me I would be so grateful.
The error is in the ”void Game::ComposeFrame” part and only there.

The error: 1>..\Assets\Game.cpp(231): error C2065: 'ix' : undeclared identifier

Please help me.

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Beginner C++ : Lesson 12 need help

Post by LuX » April 29th, 2013, 1:07 pm

It means you haven't declared 'ix'... eg. "int ix;"

If you can't get it working post the full function ( which in this case seems to be enough ).
ʕ •ᴥ•ʔ

RoyalMadBull
Posts: 3
Joined: April 29th, 2013, 11:49 am

Re: Beginner C++ : Lesson 12 need help

Post by RoyalMadBull » April 29th, 2013, 3:49 pm

Okey it did not work so here is the full function

for( int iy = 0; iy < 3; iy++ )
{
for( int ix = 0; ix < 3; ix++ );
{
if( GetSquareState( ix,iy ) == X )
{
DrawX( baseX + ix * squareSize,baseY + iy * squareSize );
}
else if( GetSquareState( ix,iy ) == O )
{
DrawO( baseX + ix * squareSize,baseY + iy * squareSize );
}
}
}

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Beginner C++ : Lesson 12 need help

Post by LuX » April 29th, 2013, 3:52 pm

"for( int ix = 0; ix < 3; ix++ );" spot the mistake...
ʕ •ᴥ•ʔ

RoyalMadBull
Posts: 3
Joined: April 29th, 2013, 11:49 am

Re: Beginner C++ : Lesson 12 need help

Post by RoyalMadBull » April 29th, 2013, 3:58 pm

I think I'll kill myself now...

Post Reply