how to pre-allocate memory for a std::string object?

后端 未结 7 1973
刺人心
刺人心 2020-11-27 18:38

I need to copy a file into a string. I need someway to preallocate memory for that string object and a way to directly read the file content into that string\'s memory?

相关标签:
7条回答
  • 2020-11-27 19:08

    std::string::reserve()

    std::getline()

    0 讨论(0)
提交回复
热议问题