Well I am attempting to shuffle a deck of cards using the random_shuffle function out of the algorithm library in the STL. I am able to print out a sorted deck of cards. I am confused on how to use the random_shuffle function on the cards array.I have googled the random_shuffle function but I am still perplexed on how to integrate the cards array. I am trying to not use magic numbers and I am trying to write better code. By the way low_val is 2 and hi_val is 14. I don't need any code just a small explanation. I will do more research on arrays.here is small snipet of code.
Also values is 15 and suits is 4.i am lost in the cards+low_val and cards+hi_val part of code.
int cards[suits][values]={0};
for(int i=low_val; i<=hi_val; i++)
{
cards[spades][i]=i;
cards[hearts][i]=i;
cards[diamonds][i]=i;
cards[clubs][i]=i;
}
random_shuffle(cards+low_val,cards+hi_val);