std::string equivalent for data with null characters?

前端 未结 5 1119
梦谈多话
梦谈多话 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:37

    std::string should be safe to do so... you only have to be careful using .c_str() method. Use .data().

提交回复
热议问题