I am making a BlackJack card game and I am trying to get the CardFlow base class to give the inherited class, Player1, the current card and it has an error of " Expression: vector iterator + offset out of range ", when I run the program and ask for a hit. Why is this not working and what does this error mean? Here are parts of the code I am having trouble with. Any help would be appreciated.




Code:
" main_program.cpp "
Player1 ph;
	
	CardFlow pCard;
	while(cardHit){ 
	                                // Loop for player to get card hits
	cardHit = ph.getHit(cardHit);
	if(cardHit == true){
		dCardHit = false;
	
	int pcur = ph.getCurrCard();
	int pCur = pcur;
	Player1 playersCount(pCur);
	int playCount = ph.getPcount();
	cout << pcur << "  "  << playCount << endl;
	}
	
	else dCardHit = true;
	

	} // End while cardHIt

" Player1.cpp" - Inherited class

int Player1::getCurrCard() 
	
{
	return CardFlow::getCurrCard();
}

"CardFlow.cpp" - Base class
int CardFlow::getCurrCard() 
{
	for(int i = 0; i <= 51; i++){
		random_shuffle (deck.begin(), deck.end());
		sort (deck.begin(), deck.begin()+25);
		random_shuffle (deck.begin(), deck.end());
		sort (deck.begin(), deck.begin()+12);
		random_shuffle (deck.begin(), deck.end());
		currentCard = deck[i];
	
	}

	return currentCard;
}