Problem with classes and Arrays
Hello i'm a newbie, i've done all the basic tutorials but i am confused about the classes;
what i want to do is make the game exploding atoms.
it requires a field of 10x10 and 2 deep to combine values.
I want this all in a class called playfield and i want to have a function called clrfield to clear the playfield
This is what I've tried so far:
Code:
class playfield
{
public:
playfield();
~playfield();
int field[10][10][2];
int expnumber;
};
playfield::playfield()
{
}
playfield::~playfield()
{
}
void clrfield()
{
int a, b;
for (a=0;a<=10;a++){
for (b=0;b<=10;b++){
playfield::field[a][b][1]=0;
}
}
}
what did i do wrong?
thnx in advance