Hi I'm making a poker game program and I need to deal 5 hands of cards(each hand has 5 cards each) in the program, each hand needs to contain different cards and we need to then display the number of pairs in each hands. I'm currently stuck in the dealing part.

This is what I have so far for dealing card:

Code:

void deal(card cards[52], card hands[5][5]) {
int i, j, cd, hd;
int value, hi, ohi, lo;
card shuff;
for(cd=0, i=0; cd<5; cd++) {
for(hd=0;hd<5;hd++) {
hands[hd][cd] = cards[i];
++i;
}
}
for(i=0;i<5;i++) {
ohi = 5;
lo = 1;
for(; lo < ohi; lo++) {
shuff = hands[i][lo];
hi = lo - 1;
while(hands[i][hi].face > shuff.face) {
hands[i][hi + 1] = hands[i][hi];
--hi;
if(hi < 0) break;
}
hands[i][hi+1] = shuff;
}
}
for(i = 0; i < 5; i++) {
printf("\nHand #%d:\n\n", i+1);
for(j = 0; j < 5; j++) {
printf("\t%s of %s, is %s \n ",cards[j%13].face,cards[j%13].suit,cards[j%26].color);
}
}
}

however, the compiled result shows all the hands has the exactly same cards. I'm not sure what Ive done wrong, can anyone help pls?