<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://fileformats.archiveteam.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://fileformats.archiveteam.org/index.php?action=history&amp;feed=atom&amp;title=Bool_%28C%2B%2B%29</id>
		<title>Bool (C++) - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://fileformats.archiveteam.org/index.php?action=history&amp;feed=atom&amp;title=Bool_%28C%2B%2B%29"/>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/index.php?title=Bool_(C%2B%2B)&amp;action=history"/>
		<updated>2026-08-30T00:58:44Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.2</generator>

	<entry>
		<id>http://fileformats.archiveteam.org/index.php?title=Bool_(C%2B%2B)&amp;diff=22478&amp;oldid=prev</id>
		<title>VolodyA! V Anarhist: released</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/index.php?title=Bool_(C%2B%2B)&amp;diff=22478&amp;oldid=prev"/>
				<updated>2015-05-13T07:04:13Z</updated>
		
		<summary type="html">&lt;p&gt;released&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 07:04, 13 May 2015&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 16:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 16:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;| uniform type&amp;#160;  =&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;| uniform type&amp;#160;  =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;| conforms to&amp;#160; &amp;#160; = &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;| conforms to&amp;#160; &amp;#160; = &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;| released&amp;#160; &amp;#160; &amp;#160;  =&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;| released&amp;#160; &amp;#160; &amp;#160;  = &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;1983&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;| image&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; = &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;| image&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; = &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;| caption&amp;#160; &amp;#160; &amp;#160; &amp;#160; = &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;| caption&amp;#160; &amp;#160; &amp;#160; &amp;#160; = &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>VolodyA! V Anarhist</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/index.php?title=Bool_(C%2B%2B)&amp;diff=22386&amp;oldid=prev</id>
		<title>VolodyA! V Anarhist at 09:15, 11 May 2015</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/index.php?title=Bool_(C%2B%2B)&amp;diff=22386&amp;oldid=prev"/>
				<updated>2015-05-11T09:15:33Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 09:15, 11 May 2015&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 64:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 64:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;}&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;}&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;This code will return &amp;quot;!=&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;This code will return &amp;quot;!=&amp;quot;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. However the following code returns &amp;quot;==&amp;quot;:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;pre&amp;gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; if((bool)a.uc == (bool)b.uc)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; {&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; std::cout &amp;lt;&amp;lt; &amp;quot;==&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; }&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; else&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; {&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; std::cout &amp;lt;&amp;lt; &amp;quot;!=&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; }&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/pre&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==Storing in a single bit==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==Storing in a single bit==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>VolodyA! V Anarhist</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/index.php?title=Bool_(C%2B%2B)&amp;diff=22385&amp;oldid=prev</id>
		<title>VolodyA! V Anarhist: oops</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/index.php?title=Bool_(C%2B%2B)&amp;diff=22385&amp;oldid=prev"/>
				<updated>2015-05-11T07:21:10Z</updated>
		
		<summary type="html">&lt;p&gt;oops&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 07:21, 11 May 2015&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 38:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 38:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;In bold you see the definition of these constants. When converting literal constant '''true''' to an integer type, you are guaranteed to get 1, converting '''false''' always yields 0.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;In bold you see the definition of these constants. When converting literal constant '''true''' to an integer type, you are guaranteed to get 1, converting '''false''' always yields 0.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;However, different &amp;quot;true&amp;quot; values will evaluate as equal when being compared.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;However, different &amp;quot;true&amp;quot; values will &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''not''' &lt;/ins&gt;evaluate as equal when being compared.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;#include &amp;lt;iostream&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;#include &amp;lt;iostream&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>VolodyA! V Anarhist</name></author>	</entry>

	<entry>
		<id>http://fileformats.archiveteam.org/index.php?title=Bool_(C%2B%2B)&amp;diff=22384&amp;oldid=prev</id>
		<title>VolodyA! V Anarhist: Created page with &quot;{{FormatInfo | name           = bool (C++) | formattype     = electronic | subcat         = Data types | subcat2        = C++ data types | subcat3        =  | subcat4        =...&quot;</title>
		<link rel="alternate" type="text/html" href="http://fileformats.archiveteam.org/index.php?title=Bool_(C%2B%2B)&amp;diff=22384&amp;oldid=prev"/>
				<updated>2015-05-11T06:05:11Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{FormatInfo | name           = bool (C++) | formattype     = electronic | subcat         = Data types | subcat2        = C++ data types | subcat3        =  | subcat4        =...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{FormatInfo&lt;br /&gt;
| name           = bool (C++)&lt;br /&gt;
| formattype     = electronic&lt;br /&gt;
| subcat         = Data types&lt;br /&gt;
| subcat2        = C++ data types&lt;br /&gt;
| subcat3        = &lt;br /&gt;
| subcat4        = &lt;br /&gt;
| subcat5        = &lt;br /&gt;
| thiscat        = &lt;br /&gt;
| extensions     = &lt;br /&gt;
| mimetypes      = &lt;br /&gt;
| locfdd         = &lt;br /&gt;
| fourccs        =&lt;br /&gt;
| pronom         =&lt;br /&gt;
| type code      =&lt;br /&gt;
| uniform type   =&lt;br /&gt;
| conforms to    = &lt;br /&gt;
| released       =&lt;br /&gt;
| image          = &lt;br /&gt;
| caption        = &lt;br /&gt;
}}&lt;br /&gt;
{{DISPLAYTITLE:bool (C++)}}&lt;br /&gt;
&lt;br /&gt;
'''bool''' can store one of two potential values '''true''' or '''false'''. Theoretically it can be done using a single bit of memory, however, RAM cannot be addressed by a single bit, therefore at least one byte is used most of the time. This opens the question which bit should be used to determine truth value, in C++ any bit set to 1 means that the value is true, however, when the literal constant '''true''' generates an integer value 1 (a single lowest bit being 1, the rest set to 0).&lt;br /&gt;
&lt;br /&gt;
{| class='wikitable'&lt;br /&gt;
! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0 !! value&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || true&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 1 || 1 || 1 || 1 || 1 || 1 || 1 || true&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || '''false'''&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0 || 0 || 0 || 0 || 0 || 0 || 1 || '''true'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In bold you see the definition of these constants. When converting literal constant '''true''' to an integer type, you are guaranteed to get 1, converting '''false''' always yields 0.&lt;br /&gt;
&lt;br /&gt;
However, different &amp;quot;true&amp;quot; values will evaluate as equal when being compared.&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
union crazyBool&lt;br /&gt;
{&lt;br /&gt;
        unsigned char uc;&lt;br /&gt;
        bool b;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
        crazyBool a, b;&lt;br /&gt;
        a.uc = 1;&lt;br /&gt;
        b.uc = 5;&lt;br /&gt;
&lt;br /&gt;
        if(a.b == b.b)&lt;br /&gt;
        {&lt;br /&gt;
                std::cout &amp;lt;&amp;lt; &amp;quot;==&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
                std::cout &amp;lt;&amp;lt; &amp;quot;!=&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
        }&lt;br /&gt;
        return 0;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code will return &amp;quot;!=&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Storing in a single bit==&lt;br /&gt;
It is possible to potentially store several bools together in less memory than if there were stored separately. This is done by placing them in a single byte, and reading their values by bit-shifting and bitwise AND operation. For example [[std::vector]] container has the specialisation for storing bool values, which does exactly that [http://www.cplusplus.com/reference/vector/vector-bool/].&lt;br /&gt;
&lt;br /&gt;
==Other C++ data types of the same size==&lt;br /&gt;
There is no other data type that can be stored in a single bit, but there are several which use a single byte.&lt;br /&gt;
* [[char (C++)|char]]&lt;br /&gt;
* [[signed char]]&lt;br /&gt;
* [[unsigned char]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Enumerable data types]]&lt;/div&gt;</summary>
		<author><name>VolodyA! V Anarhist</name></author>	</entry>

	</feed>