(C++) Not able to create objects different objects even when I give different constructor parameters : <p>I am making a basic card system in C++. It is object-oriented, of course. All I did was a class for the card stack, another for the card itself and the main class. But as I was trying to make this project, I noticed that all the cards that I made were the same! It seems to me that the problem lays on the creating of the object itself. Check it out, guys:</p>

<p>Main.cpp</p>

<pre><code>#include "Header.h"

using namespace std;


char cardTypes[4] = { CARD_TYPE_HEARTS,CARD_TYPE_SPADES,CARD_TYPE_CLUBS,CARD_TYPE_DIAMONDS };

int main(void) {

    setlocale(LC_ALL, "Portuguese");
    srand((unsigned)time(NULL));

    CardStack stack;
    for (int i = 0; i &lt; 4; i++) {
        char type = cardTypes[i];
        for (int j = 0; j &lt;= 13; j++) {
            stack.add(&amp;Card(j, type));
        }
    }
    stack.shuffle();

    cout &lt;&lt; stack.getCard(0)-&gt;translateMe() &lt;&lt; endl;
    cout &lt;&lt; stack.getCard(1)-&gt;translateMe() &lt;&lt; endl;
    cout &lt;&lt; stack.getCard(2)-&gt;translateMe() &lt;&lt; endl;

    return 0;
}
</code></pre>

<p>Header.h</p>

<pre><code>#ifndef HEADER_H
#define HEADER_H

#include &lt;iostream&gt;
#include &lt;vector&gt;
#include &lt;time.h&gt;
#include &lt;random&gt;
#include &lt;string&gt;

using namespace std;

#define CARD_POS_STACK 0

#define CARD_TYPE_HEARTS 'H'
#define CARD_TYPE_SPADES 'S'
#define CARD_TYPE_CLUBS 'C'
#define CARD_TYPE_DIAMONDS 'D'
#define CARD_TYPE_NONE ' '

#define CARD_JOKER 0
#define CARD_ACE 1
#define CARD_2 2
#define CARD_3 3
#define CARD_4 4
#define CARD_5 5
#define CARD_6 6
#define CARD_7 7
#define CARD_8 8
#define CARD_9 9
#define CARD_10 10
#define CARD_JACK 11
#define CARD_QUEEN 12
#define CARD_KING 13

class Card {

private:

    char type;  /* type can be H (hearts), S (spades), C (clubs) or D (diamonds) */
    short num;  /* coringa = 0, J = 11, Q = 12 and K = 13*/
    int pos;    /* 0 = stack */

public:

    /* &gt; Creates a card */
    Card(short num, char type);

    /* &gt; Recieves the card's type */
    char getType();

    /* &gt; Recieves the card's number */
    short getNum();

    /* &gt; Translates the number */
    string translateMe();

    /* &gt; Recieves the card's position on the table */
    int getPos();

    /* &gt; Checks if a card is equal to another */
    bool isEqual(Card* another);
};

class CardStack {

private:

    vector&lt;Card*&gt; cards;
    int numOfCards;

public:

    int getSize();

    /* &gt; Checks if there is any item in the stack */
    bool isEmpty();

    /* &gt; Add a card to the top of the stack */
    void add(Card* theCard);

    /* &gt; Remove a card from the stack */
    void remove(Card* theCard);

    /* &gt; Shuffles randomly the card */
    void shuffle();

    /* &gt; Get a certain card */
    Card* getCard(int i);

    /* &gt; Gets the card at the top of the stack */
    Card* getTopCard();

    /* &gt; Generates an empty stack */
    CardStack();

};

#endif
</code></pre>

<p>Card.cpp</p>

<pre><code>#include "Header.h"

Card::Card(short cardNum, char cardType){
    num = cardNum;

    if (cardNum = CARD_JOKER)
        type = CARD_TYPE_NONE;
    else
        type = cardType;

    pos = CARD_POS_STACK;
}

string Card::translateMe() {
    string message = "";

    switch (num) {
    case 0:
        message.append("Coringa");
        break;
    case 11:
        message.append("Valete de");
        break;
    case 12:
        message.append("Rainha de ");
        break;
    case 13:
        message.append("Rei de ");
        break;
    default:
        message.append(to_string(num)+" de ");
    }

    switch (type) {
    case CARD_TYPE_CLUBS:
        message.append("Paus");
        break;
    case CARD_TYPE_DIAMONDS:
        message.append("Ouros");
        break;
    case CARD_TYPE_HEARTS:
        message.append("Copas");
        break;
    case CARD_TYPE_SPADES:
        message.append("Espadas");
        break;
    }

    return message;
}

char Card::getType() { return type; }
short Card::getNum() { return num; }
int Card::getPos() { return pos; }
bool Card::isEqual(Card* another) { return this == another; }
</code></pre>

<p>CardStack.cpp</p>

<pre><code>#include "Header.h"
#include &lt;algorithm&gt;

bool CardStack::isEmpty() {
    return numOfCards == 0 ? true : false;
}

void CardStack::add(Card* theCard) {
    cards.push_back(theCard);
}

void CardStack::remove(Card* theCard) {
    for (int i = 0; i &lt; cards.size(); i++)
        if (theCard-&gt;isEqual(cards[i]))
            cards.erase(cards.begin() + i);
}

CardStack::CardStack() {
    numOfCards = 0;
}

void CardStack::shuffle() {
    random_shuffle(cards.begin(), cards.end());
}

Card* CardStack::getCard(int i) {
    return cards.at(i);
}

Card* CardStack::getTopCard() {
    return cards.front();
}

int CardStack::getSize() {
    numOfCards = cards.size();
    return numOfCards;
}
</code></pre>

<p>And the output is the following:</p>

<pre><code>"Rei de Ouros"
"Rei de Ouros"
"Rei de Ouros"
</code></pre>
