This doesn't seem to work:
Code:
class BunchOfCards
{
public:
Card DealACard();
friend ifstream& operator >>(ifstream& ifs, BunchOfCards& bcds);
friend ostream& operator <<(ostream& ofs, BunchOfCards bcds);
private:
vector <Card> mSomeCards;
};
Card BunchOfCards::DealACard()
{
Card b, targetPosition;
targetPosition=mSomeCards.size();
for(int i=targetPosition;i<mSomeCards.size();i++)
{
mSomeCards[i]=mSomeCards[i+1];
}
mSomeCards.pop_back();
return b;
}
Now, I'm trying to do something here, and I know that I am not doing it right. I've got to start somewhere, so I have. I have been instructed to:
Consider that the last card pushed back onto the vector is the "top" of the BunchOfCards. Write a member function that takes the top card off of BunchOfCards.
...Returns the top card and takes the card out of the bunch of cards.
I am a bit lost here as well. Thanks