Hi,
I need a deep copy constructor for a class which contains an array for another class:
class Chessboard
{
public:
ChessSquare chessSquare[64];
// copy constructor needed to copy all chessSquare and attributes
}
class ChessSquare
{
public:
int column;
int row;
}
void main (void)
{
Chessboard a1;
Chessboard a2 = a1; //deep copy needed. any suggestions for a deep copy constructor?
}
Any one can post something that can help this case? Thanks.
I need a deep copy constructor for a class which contains an array for another class:
class Chessboard
{
public:
ChessSquare chessSquare[64];
// copy constructor needed to copy all chessSquare and attributes
}
class ChessSquare
{
public:
int column;
int row;
}
void main (void)
{
Chessboard a1;
Chessboard a2 = a1; //deep copy needed. any suggestions for a deep copy constructor?
}
Any one can post something that can help this case? Thanks.
Comment