mhaggard
November 19th, 2012, 01:38 AM
can someone please help me? I am stuck just trying to make the deck. My partner and I have been working on this for about two weeks now and I have decided to pretty much scrap the other code and make a new one. The project is due tonight (I know good timing huh) and I don't understand why it keeps telling me that 'class Deck has no member named push.'
Any help would be appreciated
// Blackjack
#include <iostream>
#include <stack>
#include <string>
#include <vector>
#include <cstdlib>
#include <fstream>
#include <ctime>
using namespace std;
string suit[4] = { "CLUBS", "DIAMONDS", "HEARTS", "SPADES" };
string value[13] = { "ACE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "TEN", "JACK", "QUEEN", "KING" };
struct Card {
int value, suit;
Card(int value, int suit);
string toString();
};
class Deck{
public:
stack<Card> deck;
};
int main(){
Deck deck;
for(int i = 0; i < 13; i++){
for(int j = 0; j < 4; j++){
Card card(i, j);
deck.push(card);
}
}
return 0;
}
Any help would be appreciated
// Blackjack
#include <iostream>
#include <stack>
#include <string>
#include <vector>
#include <cstdlib>
#include <fstream>
#include <ctime>
using namespace std;
string suit[4] = { "CLUBS", "DIAMONDS", "HEARTS", "SPADES" };
string value[13] = { "ACE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "TEN", "JACK", "QUEEN", "KING" };
struct Card {
int value, suit;
Card(int value, int suit);
string toString();
};
class Deck{
public:
stack<Card> deck;
};
int main(){
Deck deck;
for(int i = 0; i < 13; i++){
for(int j = 0; j < 4; j++){
Card card(i, j);
deck.push(card);
}
}
return 0;
}