My teacher once told me if I am using a lot of repetitive code chances are I'm doing something wrong or inefficiently. What I'm trying to do is create a deck of card but instantiating each card (52) seems very redundant. Am i doing this correctly or is there a better method to do this? Keep in mind I am still very much a beginner. This is what I've done so far:
Does this mean you initialized a vector that contains 13 elements of the CardDeck type? That is wayyyyyyyyyyy more efficient. And i also realized it was suit after i posted haha. And also is it better to put constint cards_per_suit = 13; in main or global?
@helios
Can you explain the template part?
CardDeck card_template = {"DIAMOND", 0, 0};
I think i get the gist of the code but im still a novice programmer and the first line is a little confusing. Is that a template class? Or am i confusing this with something else? And yea it does sound weird but it was because i was initially going to create a class for the entire deck when i just needed it for a single card template.