User Profile

Collapse

Profile Sidebar

Collapse
unicorn7777777
unicorn7777777
Last Activity: Apr 11 '07, 08:40 AM
Joined: Nov 23 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • 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...
    See more | Go to post

    Leave a comment:


  • unicorn7777777
    replied to Passing Enums to a constructor?
    in C
    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?
    See more | Go to post

    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)
    {

    ...
    See more | Go to post

  • unicorn7777777
    started a topic Passing Enums to a constructor?
    in C

    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...
    See more | Go to post
No activity results to display
Show More
Working...