sizeof (char) and sizeof (bool) are 1 (in my compiler / system / regardless, I heard that this is not always the same value), bool can only store true or false, while a char can take more values and can act as several bool variables using bitwise operators (8 bits, each bit can be used as 1 bool for a total of 8 bools)
So, is there any advantage when using bool instead of char?
So besides readability, is there anything else? I read somewhere that int is processed faster than short or byte, even if it takes up more memory. Is there any speed difference between char and bool?
source
share