C/C++ Bit Array or Bit Vector

前端 未结 5 1303
北荒
北荒 2020-12-05 12:29

I am learning C/C++ programming & have encountered the usage of \'Bit arrays\' or \'Bit Vectors\'. Am not able to understand their purpose? here are my doubts -

5条回答
  •  借酒劲吻你
    2020-12-05 13:07

    That is used for bit flags storage, as well as for parsing different binary protocols fields, where 1 byte is divided into a number of bit-fields. This is widely used, in protocols like TCP/IP, up to ASN.1 encodings, OpenPGP packets, and so on.

提交回复
热议问题