c++ - Convert vector of uint8 to string -


i have pointer vector of type uint8.

how take pointer , convert data in vector full string representative of content?

you initialize std::string sequence obtained std::vector<uint8_t>:

std::string str(v->begin(), v->end()); 

there no need play tricks checking whether std::vector<uint8_t> empty: if is, range empty. however, might want check if pointer v null. above requires points valid object.


Comments

Popular posts from this blog

android - Inheriting from Theme.AppCompat* -

broadcastreceiver - android BOOT_COMPLETED not received if not activity intent-filter -

basic authentication with http post params android -