mercredi 8 décembre 2021

Declaring a value to int in arrays

I'm trying to make a deck of cards with only using array and no classes.

How do I declare a value to each and every card? It seems very inefficient trying to write it like this, and then trying to give a value to each index position:

int deckOfcards[52]{ 1,2,3,4,5,6,7,8,9,10.......... };

Also I will then draw 2 random cards and declare a winner. Is it possible to use rand() function in arrays?




Aucun commentaire:

Enregistrer un commentaire