Why regenerate the numbers? Just create a vector or list. Initialize it with the cards. Call random_shuffle to generate a random sequence. Each time you deal, just start at a different point in the array or list and wrap around to the beginning when you reach the end, or if you use a list, just remove the head, make it the new tail, then redeal.