Yes, I'm getting closer, I think:
Code:
class Card
{
public:
friend ifstream& operator >>(ifstream& is, Card& cd);
friend ostream& operator <<(ostream& os, Card cd);
private:
string mSuit;
int mValue;
};
class BunchOfCards
{
public:
friend ifstream& operator >>(ifstream& ifs, vector <Card> aDeck);
private:
vector <Card> mSomeCards;
};
And:
Code:
ifstream& operator >>(ifstream& ifs, vector <Card> aDeck)
{
ifs>>aDeck;
return ifs;
}
...but what here?
Code:
int main()
{
BunchOfCards aDeck;
ifstream aStreamOfCards;
aStreamOfCards.open("Deck.dat");
while(aStreamOfCards>>aDeck)
{
system("pause");
return 0;
}