My solution for lecture 25

I simply call the AskToPlayAgain(); method for the condition for the do{} while(), and it works perfectly fine. In this way, I don’t need another declaration or variable.

int main()
{

do
{
	PrintIntro();
	PlayGame();
} 
while (AskToPlayAgain());

return 0; //exit the application

}

I have done this the same way. Are we correct in what we have done or will this cause issues further down the line?

For me, it is not causing any problem, but I am sure it is some difference in the performance.

Privacy & Terms