You may find the following code useful: /* some strings for printing */ const char *HAND_STRINGS [] = {"Royal Flush", "Straight Flush", "Four of a Kind", "Full House", "Flush", "Straight", "Three of a Kind", "Two Pair", "One Pair", "High Card"}; /* the init_rand function */ void init_rand (int seed) { /* if calling function passes 0, set to semi-random value */ if (seed == 0) { struct tm *tm_ptr; time_t clock; clock = time (NULL); tm_ptr = gmtime (&clock); srand (tm_ptr -> tm_sec); } else srand (seed); } /* here's a way to read in a file to store the deck */ void read_deck (DECK_T *deck) { FILE *fp; char name [30]; int i; printf ("\nPlease enter file name with deck data: "); scanf ("%s", name); if ((fp = fopen (name, "r")) == NULL) { printf ("invalid file namen"); return; } for (i = 0; i < NUM_CARDS; i++) { fscanf (fp, "%d %c", &(deck -> cards [i].value), &(deck -> cards [i].suit)); } }