I need help with my function, this is what I have done.
void ShuffleCards(int (*deck_of_cards)[NUM_CARDS])
{
int i = 51;
int j, temp;
while(i>0)
{
j = rand()%(i+1);
temp = *deck_of_cards[i];
*deck_of_cards[i] = *deck_of_cards[j];
*deck_of_cards[j] = temp;
i--;
}
}
I have been getting segmentation fault because I'm unsure of what has to be coded properly before the swapping occurs. Help me please.