The idea of the entire program is to play a simplified version of war that's why its 28 cards. Anyway my problem comes from the dealRandomCard function when I compile it it says there needs to be another ) before time. I'm not sure what to do.
I appreciate the help so thank you in advance.
#include <cstdlib>
#include <ctime>
#include <iostream>
void dealCardSet(int [], int [], int [], int [], int);
void dealRandomCard(int [], int [], int [], int [], int);
int main(){
int cards;
int P1Cards[cards], P1Suit[cards], CompCards[cards], CompSuit[cards];
dealCardSet(P1Cards, P1Suit, CompCards, CompSuit, cards);
return 0;
}
void dealCardSet(int P1Cards[], int P1Suit[], int CompCards[], int CompSuit[], int cards){
cout << " How many cards do you want to play?(1-28) ";
cin >> cards;
for (int i=0;i<cards;i++)
dealRandomCards(P1Cards, P1Suit, CompCards, CompSuit, cards);
}
void dealRandomCard(int P1Cards[], int P1Suit[], int CompCards[], int CompSuit[], int cards){
for(int i = 0; i<cards; i++){
srand((P1Cards[i])time(0));
srand((CompCards[i]time(0));
for (int index=0; index<cards;index++){
P1Cards[i]=(rand()%14)+1;
CompCards[i]=(rand()%14)+1;
Cout << P1Cards[i];
Cout << CompCards[i];
}
}
for(int j = 0; j<cards; j++){
srand((P1Suit[j])time(0));
srand((CompSuit[j]time(0));
for (int index2=0; index2<cards;index2++){
P1Suit[j]=(rand()%14)+1;
CompSuit[j]=(rand()%14)+1;
Cout << P1Suit[j];
Cout << CompSuit[j];
}
}