Quote:Original post by jeff8jSomething like this:
Im little(a lot) lost on how to implement vector<char> into my code do you think you could modify my c++/imaginary code up above to show me the theory. (it wouldnt have to work just more of a guideline)
std::vector<char> Receive() { std::vector<char> buffer(1024); int rv = recv(s_, &buffer[0], buffer.size(), 0); if (rv <= 0){ // error... } buffer.resize(rv); return buffer;}
(This version isn't that efficient since it returns a whole new copy of the vector, but you can pass a reference to a vector to fill in perhaps)