简体   繁体   中英

c++ how to send const std::vector<std::uint8_t> over socket?

I want to send vector<uint8_t> over socket but the send() func takes only const char* as a parameter.

my vector contains Pixels (over 4 million element).

thank you in advance.

只需将向量的数据转换为const char*

reinterpret_cast<const char*>(my_vector.data())

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM