Is it valid, to use std::string to hold binary data, to avoid manual dynamic memory management June 2, 2023 by Tarik Yes, you can store any sequence of char in a std::string. That includes any binary data.