Need help with Card Dealing Program

I'm currently making a card dealing program, it is suppose to display a list of cards like this:
"Ace of Heart, is red"
"Two of Heart, is red"
.
.
"Ace of Spade, is black"
and so on for all suits and numbers.

here is my current code:

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

struct card { 
 const char *face;
 const char *suit;
 const char *color;
};

typedef struct card Card;
typedef unsigned char pairs;

const char *face[] = { "Ace", "Two", "Three", "Four", "Five","Six", "Seven",
                                  "Eight", "Nine", "Ten","Jack", "Queen", "King"};
const char *suit[] = { "Hearts", "Diamonds", "Clubs", "Spades"};
const char *color[]= {"Black","Red"};
void printdeck( const Card * const );
void fillDeck( Card * const, const char *[], const char *[] ,const char *[]);
void deal(card cards[52], card hands[5][5]);
int main()
{
int hand,cd,winner;
card hands[5][5],handssorted[5][5];
pairs numpairs[5],highest;
Card deck[52];
srand( time( NULL) );
fillDeck( deck, face, suit, color );
printdeck(deck);
printf("\n ----------------------------------------------------------\n");

system("pause");
return 0;

}
//------------------------------------------------------------------------------------------------------
void fillDeck( Card * const wDeck, const char * wFace[], const char * wSuit[], const char * wColor[])
{
		   int i;
		   for ( i = 0; i <= 51; i++ ) { 
		      wDeck.face  = wFace[ i % 13 ];
		      wDeck.suit  = wSuit[ i / 13 ];
		      wDeck.color = wColor[i%2];
        }
}
//-----------------------------------------------------------------------------------------------------
void shuffle( Card * const wDeck )
{
		   int i, j;
		   Card temp;
		   for ( i = 0; i <= 51; i++ ) { 
		      j = rand() % 52;
		      temp = wDeck[ i ];
		      wDeck[ i ] = wDeck[ j ];
		      wDeck[ j ] = temp;
}
}
//-----------------------------------------------------------------------------------------------------------
void printdeck( const Card * const wDeck )
{
           int i;
		   for ( i = 0; i <= 51; i++ ){
		      printf( "\t%s\t of \t%-8s is \t%s \n \t", wDeck.face, 
		              wDeck.suit,wDeck.color,
		             ( i + 1 ) % 2 ? '\t' : '\n' );}
}

but the output i get it wrong because it shows:
"Ace of Hearts is Black"
"Two of Hearts is Red"
"Three of Hearts is Black"
.
.
the color displayed is wrong. Im not sure what im doing wrong, can anyone pls help.

I'm not much of a cardshark, but if all hearts/diamonds are supposed to be red and all clubs/spades are intended to be black, you could switch the order of the colors in the color array and use wColor[i/26] to get the job done. However, even though that's the shortest path to accomplishing the task (using your current code as a starting point), it's not a good solution; it creates a dependency between disparate lines of code that is not apparent and would require some documentation to highlight the hazard.

It would be better to use a different approach which makes clear the relationship between suit and color.

Regards,
Alister

In filldeck, you assign the color by

wDeck.color = color[i % 2];

This means, that it will always alternate between black - red - black - red - etc... after every card! I am not sure which color diamaonds have (arent they blue?), so a very simple approach would be (where I assume all but hearts is black):

wDeck.color = (wDeck.suit == wSuit[0]) ? "Red" : "Black";

Why not have each card as a unique number, and decide from that number what suit it is? The suit defines the color, so that solves both problems.

#include <stdio.h>

enum suit_t
{
        // Arranged in this order to get black/red/black/red.
        SUIT_CLUB=0,    // 0 & 1 == 0.  Black.
        SUIT_HEART=1,   // 1 & 1 == 1.  Red.
        SUIT_SPADE=2,   // 2 & 1 == 0.  Black.
        SUIT_DIAMOND=3  // 3 & 1 == 1.  Red.
};

enum card_t
{
        CARD_MIN=0, CARD_MAX=52,

        // Cards are numbered as 0, 4, 8, 12, etc.  The first 2 bits decide the suit.
        CARD_ACE=(0<<2),      CARD_2=(1<<2),
        CARD_3=(2<<2),          CARD_4=(3<<2),
        CARD_5=(4<<2),          CARD_6=(5<<2),
        CARD_7=(6<<2),          CARD_8=(7<<2),
        CARD_9=(8<<2),          CARD_10=(9<<2),
        CARD_JACK=(10<<2),      CARD_QUEEN=(11<<2),
        CARD_KING=(12<<2)
};

const char const *cardnames[]={
        "Ace", "Two", "Three", "Four", "Five", "Six", "Seven",
        "Eight", "Nine", "Ten", "Jack", "Queen", "King", NULL };

const char const *colornames[]={ "Black", "Red", NULL };
const char const *suitnames[]={"Clubs", "Hearts", "Spades", "Diamonds", NULL };

#define CARD_NAMESTR(X)         (cardnames[(X)>>2])
#define CARD_SUITSTR(X)         (suitnames[(X)&SUIT_DIAMOND])
#define CARD_COLORSTR(X)        (colornames[((X)&1)])

int main(void)
{
        int card;

        for(card=CARD_MIN; card < CARD_MAX; card++)
        {
                printf("card %d is the %s of %s, and is %s\n", card,
                        CARD_NAMESTR(card), CARD_SUITSTR(card),
                        CARD_COLORSTR(card));
        }
}
card 0 is the Ace of Clubs, and is Black
card 1 is the Ace of Hearts, and is Red
card 2 is the Ace of Spades, and is Black
card 3 is the Ace of Diamonds, and is Red
card 4 is the Two of Clubs, and is Black
card 5 is the Two of Hearts, and is Red
card 6 is the Two of Spades, and is Black
card 7 is the Two of Diamonds, and is Red
...
card 44 is the Queen of Clubs, and is Black
card 45 is the Queen of Hearts, and is Red
card 46 is the Queen of Spades, and is Black
card 47 is the Queen of Diamonds, and is Red
card 48 is the King of Clubs, and is Black
card 49 is the King of Hearts, and is Red
card 50 is the King of Spades, and is Black
card 51 is the King of Diamonds, and is Red