The assumption is that the elements of array contain "representations" of the cards in the deck (or whatever you are shuffling.

for( i=1; i<sizeof(array)/sizeof(arr

// sizeof(array) will result in the total number of bytes in the array

// sizeof(array[0]) will result in the number of bytes in the first element

// thus sizeof(array)/sizeof(array

// i.e. it is a general way of setting the number of iterations

int r = random()%(i+1);

//random() (or the more standard rand() return

// a pseudo-random number in the range 0 - RAND_MAX

// by modding it with i+1 you will get a number from 0 to i

int temp = array[i]; array[i] = array[r]; array[r] = temp;

// shuffle: take the "next" "card" (in array[i])

// and swap it with the card in array[r]

}