Hey just wondering if someone could help me please with the following:
board.h
public:
Piece* Player1Pieces;
Piece* Player2Pieces;
(a section showing the initialization of the arrays)
board.C:
Player1Pieces = new Piece[18];
Player2Pieces = new Piece[18];
char arrX[9] = {'a','b','c','d','e','f','g','h','i'};
for (int FootCount = 0; FootCount < 9; ++FootCount)
{
--->> Player1Pieces[FootCount] = new FootSoldier(1,arrX[XCount],1); <<---
Player2Pieces[FootCount] = new FootSoldier(2,arrX[XCount],7)
(this is where I initialize the objects to the specific type I want)
The error:
(between the arrows)
Piece.h:13: note: candidates are: Piece& Piece::operator=(const Piece&)
board.C:28: error: expected `;' before ‘FootSoldier’
board.C:29: error: expected type-specifier before ‘FootSoldier’
board.C:29: error: no match for ‘operator=’ in ‘*(((Board*)this)->Board::Player2Pieces + ((unsigned int)(((unsigned int)FootCount) * 24u))) = (int*)operator new(4u)’
The pointer to the array of objects is thus specified in the .h file, and initialized in the .C file, but I get these weird errors?
Any help would be very much appreciated!