A qustion about Vectors with constructors.
Hi all
I am going to create a program a Deck ADT that represents a deck of playing cards. The Deck ADT will use a vector to store 52 individual Crad objects.
Here is my program
Code:
#ifndef deck_h
#define deck_h
#include <vector>
#include <cstdlib>
class Deck
{
public:
Deck() {card.reverse(52);} // Default constructor, sets the
initial size of 52
void shuffle(); // This is what i don't know to do
private:
vector<int> card; // STL vector of type card.
};
#endif
I am going to create a public method to shuffle the deck. However, i feel confuse how i should code in this method.
Which return type i should use? void or int?
and can i use RANDOM method from c standard library?
Pls give me some advise, thanks.