C++ STL's String eqivalent for Binary Data

后端 未结 5 1729
北恋
北恋 2020-12-23 14:45

I am writing a C++ application and I was wondering what the C++ conventional way of storing a byte array in memory.

Is there something like a string, except specifi

5条回答
  •  情深已故
    2020-12-23 15:05

    I'd use std::vector. Most operations you need can be done using the STL with iterator ranges. Also, remember that if you really need the raw data &v[0] is guaranteed to give a pointer to the underlying array.

提交回复
热议问题