I've been googling and reading about this and didn't come up with an answer yet, maybe someone can help me with this.
I want my UserPile class to be able to access data members and class member functions from my CardPile class. I keep getting the error mention in the title. Could someone explain what is happening? The inheritance tutorials I have seen look just like my code except mine is multiple source code files.
//CardPile.h
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Card;
class CardPile
{
protected:
vector<Card> thePile;
//Card thePile[];
int pileSize;
public:
CardPile();
void insertCard( Card );
Card accessCard( int);
void displayPile();
void shuffle(); //shuffle the pile
void initializeDeck(); //create deck of cards
void deal(CardPile &, CardPile &);
void showHand();
bool checkForAce();
void discard(CardPile);
void drawCard(CardPile &);
};
//UserPlayer.h
using namespace std;
class UserPlayer: public CardPile
{
private:
//CardPile userPile;
public:
UserPlayer();
};
//UserPlayer.cpp
#include "UserPlayer.h"
#include "CardPile.h"
UserPlayer::UserPlayer()
{
}
I don't have anything happening in this UserPlayer class yet, because I will be using functions from the base class, so I want to at least see it compile before I start writing it.
Thanks for anyone's help.