vector vs string for binary data

后端 未结 9 2180
日久生厌
日久生厌 2020-12-05 07:25

Which is a better c++ container for holding and accessing binary data?

std::vector

or

std::string
         


        
9条回答
  •  情书的邮戳
    2020-12-05 07:31

    If you just want to store your binary data, you can use bitset which optimizes for space allocation. Otherwise go for vector, as it's more appropriate for your usage.

提交回复
热议问题