I want to write data from an std::vector<char>
to a socket, using the write
function, which has this prototype:
ssize_t write(int, const void *, size_t);
The second argument to this function must be a pointer to the first element in the std::vector<char>
. How can I get a pointer to this element?
I tried std::vector::front
but this returns a reference, while I need a pointer.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…