ok then there's another problem.
What if i want to copy values of a chessboard that is a pointer to a value that is a normal Chessboard?
For example.
line 1: Chessboard *pBoard = CurrBoard;
line 2: Chessboard c2 = (*pBoard); // i need a deep copy of Currboard into c2..... will this work?
I know c2 = CurrBoard will work, but for some reason, when I pass a pointer through a function...
User Profile
Collapse
-
its to "set" the attributes in the class
For example, if u have a AI, u want to set it such that is is BLACK. or WHITE...
enum FACTION{
BLACK,
WHITE
}
AICLASS myAIclass(BLACK );
am i doing something wrong here?Leave a comment:
-
Deep copy constructor needed for an class array within another class
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)
{
... -
Passing Enums to a constructor?
HI guys, i'm writing a program but i realised I need some help with enums as i'm not too familiar with it.
In this program,
class.cpp
#include "class1.h"
class1::class1( mynewenum c) // <---------PROBLEM c gets a "undefined" value
{
mne = c;
}
class1.h
enum mynewenum
{
RATS,
SILLY,
DUNWORK...
No activity results to display
Show More
Leave a comment: