Original Post
I know this is a really easy thing but I'm just a beginner. Hopefully someone can easily steer me in the right direction. I'm making a Blackjack game and I'm trying to insert a cut card into a deck (which is a vector of cards) at a specific spot. Here's the function. void Shoe::insertCutCard(void) { Card cutCard; int iRandomNum = rand(); int iFifthOfDeck = vCards.size() * (1/5); int iSeventhOfDeck = vCards.size() * (1/7); cutCard.iSuit = 0; cutCard.iValue = 0; cutCard.bFacingUp = false; int iCutPos = (iRandomNum % (iFifthOfDeck - iSeventhOfDeck) + iFifthOfDeck); vCards.insert(iCutPos, cutCard); } I believe that I need to use a iterator when using insert but I cant find a good way to make an interator equal iCutPos. Any help on the matter would be much appreciated.