std::string equivalent for data with null characters?

前端 未结 5 1120
梦谈多话
梦谈多话 2021-01-13 18:57

I\'d like to read a binary file and use something like std::string that automatically resizes the buffer and such.

I\'m using Visual C++. What are my op

5条回答
  •  执念已碎
    2021-01-13 19:54

    You can always use std::vector v (or whatever type of input you expect) and then to get at the buffer you simply &v[0] and v.size() for the size.

提交回复
热议问题