I got the error at the end of the lines, what's wrong?
Code:
#include <stdio.h>
#include <iostream>
#include <math.h>
#include <time.h>
#include <stdlib.h>
#include <conio.h>
#include <iomanip>
#include <string>
class deck
{
public:
enum Card_Type {hearts, diamonds, spades, clubs};
Card_Type theType[4];
int theRank[13];
deck()
{
initialize();
}
private:
void initialize (){
for (int i = 0; i < 3; i++)
{
switch (i){
case 0: theType[i] = hearts;
break;
case 1: theType[i] = diamonds;
break;
case 2: theType[i] = spades;
break;
case 3: theType[i] = clubs;
break;
}
for (int i = 0; i < 12; i++)
{
theRank[i] = i;
}
}
};
void retriev (deck& in)
{
srand(time(NULL));
cout<<"Random selection from a deck!\n";
cout<<"You got "<<in.theRank[rand()%12]<<" of "<<in.theType(rand()%3);
}
int main()
{
deck one;
retriev (one);
system("pause");
return 0;
}