Because every C++ data type must be addressable.
How would you create a pointer to a single bit? You can't. But you can create a pointer to a byte. So a boolean in C++ is typically byte-sized. (It may be larger as well. That's up to the implementation. The main thing is that it must be addressable, so no C++ datatype can be smaller than a byte)
سوال خوبی بود. آره .یک بایت میخواد. یه جا خوندم حداقل یک بایت و بسته به نوع کامپیالر داره
بیشترشونم گفتن بخاطر اینکه آدرسدهی بر اساس حداقل یک بایته و کمتر نمیشه ادرس دهی کرد.
C does have a bool but it is often simulated with byte sized storage (i.e. a char)
The exact size of a boolean will be compiler-specific but will probably always be at least one byte.
فکرم نکنم بشه از بقیه بیتها استفاده کرد. چون همون یک بایته و یا صفره یا یک
به نظر معقول میاد یه unsigned char تعریف کنین که اعداد بین صفر تا 255 رو نگه میداره یک بایته و میتونین اعمال مختلفو روش انجام بدین (رو تک تک بیتهاش)
مثلا اگه بیت اولشو میخواین عددتونو با 1 اند کنین.و...