I'm trying to create a program that will deal a random card, and I am VERY confused about how to go about making it. I understand arrays/strings in general but I have no idea where to start. My professor states that we will use the function rand() which returns pseudo- random numbers starting with the seed. Seed the random number generator with the function srand({number}). He also suggests to use the function time(); xTime = time(NULL); (I have no idea what that means) Also, something about stand(time(NULL));
I THINK Ive created my arrays right, but thats about it. Im very new to programming and its not coming easy to me, so please dont be too hard on me. Thanks
#include <iostream>
#include <string>
#include "math.h"
#include "time.h"
int main()
{
int suit[4] = {heart, diamond, club, spade};
int rank[13] = {ace, 2, 3, 4, 5, 6, 7, 8, 9, 10, jack, queen, king};
system("pause");
}
srand()
{
std::cout >> suit[4] >> rank[13];
return 0;
}