c++ - std::array<char, N> to std::string -


what best way convert std::array<char, n> std::string?

i have tried producing template method have had no luck. think c++ skills aren't scratch. there idiomatic way of doing in c++?

i won't "best way", a way use std::string's iterator constructor:

std::array<char, 10> arr; ... // fill in arr std::string str(std::begin(arr), std::end(arr)); 

Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -