I searched on Google and read about it and have not yet come up with an answer, maybe someone can help me with this.
I want my UserPile class to be able to access the data elements and members of the class from the CardPile class. I keep mentioning a mistake in the title. Can someone explain what is happening? The inheritance tutorials that I saw look just like my code, except mine, are a few source code files.
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Card;
class CardPile
{
protected:
vector<Card> thePile;
int pileSize;
public:
CardPile();
void insertCard( Card );
Card accessCard( int);
void displayPile();
void shuffle();
void initializeDeck();
void deal(CardPile &, CardPile &);
void showHand();
bool checkForAce();
void discard(CardPile);
void drawCard(CardPile &);
};
using namespace std;
class UserPlayer: public CardPile
{
private:
public:
UserPlayer();
};
#include "UserPlayer.h"
#include "CardPile.h"
UserPlayer::UserPlayer()
{
}
Nothing is happening for me in this UserPlayer class, because I will use functions from the base class, so I want to at least see its compilation before I start writing.
Thanks for the help.