How many characters can you store with 1 byte?

前端 未结 4 1776
深忆病人
深忆病人 2020-12-12 19:20
1 byte = 8 bits 

So, does this mean 1 byte can only hold one character? E.g.:

\"16\" uses 2 bytes , \"9\" uses 1 byte , \"a\" uses          


        
4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-12 19:52

    2^8 = 256 Characters. A character in binary is a series of 8 ( 0 or 1).

       |----------------------------------------------------------|
       |                                                          |
       | Type    | Storage |  Minimum Value    | Maximum Value    |
       |         | (Bytes) | (Signed/Unsigned) | (Signed/Unsigned)|
       |         |         |                   |                  |
       |---------|---------|-------------------|------------------|
       |         |         |                   |                  |
       |         |         |                   |                  |
       | TINYINT |  1      |      -128 - 0     |  127 - 255       |
       |         |         |                   |                  |
       |----------------------------------------------------------|
    

提交回复
热议问题