I'm trying to make a blackjack program for my comp sci class and one thing I can do for extra credit is add a feature that allows a user to play a new game at the end of the first game (and replay games after each game).
My thought is to do the following:
* in the main() function, create a new instance of the blackjack class that will handle gameplay
* add a function that asks the user if they want to play a new game once the game is finished.
* if they want to play a new game I want to destroy the current blackjack instance and create a new one to proceed with the new game
How can I achieve the destruction/creation of an instance of the blackjack class within the class itself?
Is there a better way of doing this?