What is the function of the main() function?

The function main() appears to set a range for the difficulty from 2 to 10 by defining them as integers. Following that a while statement recognizes that range. Then the function calls to the void PlayGameAtDifficulty(difficulty); std::cin.clear(); clears the invalid answers. I’m not sure what std::cin.ignore(); does but I assume it ignores the valid answers that the program recognizes that were not input. ++ increases the difficulty over time. std:: cout <<WOW…; is the return if you got the correct answer. return 0; is what happens if you didn’t answer correctly.

Privacy & Terms