Science, Tech, Math › Computer Science Definition of Bool Share Flipboard Email Print Computer Science C & C++ Programming PHP Programming Perl Python Java Programming Javascript Programming Delphi Programming Ruby Programming Visual Basic View More By David Bolton David Bolton Computer Science Expert B.A., Computer Science, Queen's University Belfast David Bolton is a software developer who has worked for several major firms, including Morgan Stanley, PwC, BAE Systems, and LCH. Learn about our Editorial Process Updated on June 01, 2017 Definition: Bool is a fundamental type in C, C++ and C# languages. Variables of this type can only take two values- 1 and 0. In C++ these correspond to true and false and can be used interchangeably. In C# bool variables can only use true and false, they are not interchangeable with 1 and 0. Boolean variables can be packed together to save memory space. An understanding of binary can be a useful skill. Note Because of the way false and 0 are usually treated the same (except in C#), any non zero value is the same as true, not just 1. Also Known As: Boolean Examples: Using a bool and checking for true/false improves readability of your program Cite this Article Format mla apa chicago Your Citation Bolton, David. "Definition of Bool." ThoughtCo, Apr. 5, 2023, thoughtco.com/definition-of-bool-958287. Bolton, David. (2023, April 5). Definition of Bool. Retrieved from https://www.thoughtco.com/definition-of-bool-958287 Bolton, David. "Definition of Bool." ThoughtCo. https://www.thoughtco.com/definition-of-bool-958287 (accessed May 28, 2023). copy citation Featured Video