Skip to main content
Question Protected by gnat

We had an assignment for our class where we had to create a tic-tac-toeTic-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 intan 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 2two values in an intint rather than storing it in a bool? What is the exact purpose of these variables?

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?

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 an 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 two values in an int rather than storing it in a bool? What is the exact purpose of these variables?

Tweeted twitter.com/#!/StackProgrammer/status/193340413422223361
Source Link
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?