Hello there people, I'm trying to create a backgammon game using C++ and I am getting an annoying error
error C2228: left of '.length' must have class/struct/union
Here is the code it is refering to
diceArray = new int[4];
for(int i = 0;i<diceArray.length;i++)
diceArray = d1;
I have declared diceArray as a pointer
int* diceArray; //stores dice rolls
can anyone help?
Also i get this error
error C2440: 'return' : cannot convert from 'int *' to 'int'
When trying to use this code
int board2::getDiceArray()
{
//returns the diceArray[]
return diceArray;
}
I was converting from Java initially
Any help will be greatly appreciated.