I won’t say it is the “best way”, but a way is to use std::string
‘s iterator constructor:
std::array<char, 10> arr;
... // fill in arr
std::string str(std::begin(arr), std::end(arr));
I won’t say it is the “best way”, but a way is to use std::string
‘s iterator constructor:
std::array<char, 10> arr;
... // fill in arr
std::string str(std::begin(arr), std::end(arr));