Skip to main content
1 of 2
Bugster
  • 4k
  • 9
  • 39
  • 44

When should you use bools in C++?

We had an assignment for our class where we had to create a tic-tac-toe game. People like to complicate themselves, so they wrote complex games which included menus. At the end of the game, you had to have the option to play again or quit the program. I used a int variable for that, but I noticed some classmates using BOOLs.

Is it more efficient? What's the difference, between storing an answer that should only store 2 values in an int rather than storing it in a bool? What is the exact purpose of these variables?

Bugster
  • 4k
  • 9
  • 39
  • 44