Calling main like that is not legal. Move almost all your code into another function, then call that function in a while loop in main. A simple way to get it to repeat is to return true if you want to continue and false if you want to exit. Or you can return an int (like the response from the user) and break out of the loop based on the int.