Why is a boolean 4 bytes in .NET?

前端 未结 6 2267
我在风中等你
我在风中等你 2020-11-29 07:54

Why does a System.Boolean take 4 bytes? It just stores one state, either true or false, which could be stored in less space than 4 bytes.

6条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-29 08:47

    I think it's only for performance, 32 bit values are much more efficient to manipulate.

提交回复
热议问题