I'm getting a buffer from the internet, I believe that to traverse this buffer and find the last character, you need to find the character '\ 0'. But there is no '\ 0' in a buffer.
Can I force this buffer to behave like a string?
I'm getting a buffer from the internet, I believe that to traverse this buffer and find the last character, you need to find the character '\ 0'. But there is no '\ 0' in a buffer.
Can I force this buffer to behave like a string?
Adds p% of% to the buffer. But attention to binary data !!
length = recv(socket, buffer, sizeof buffer - 1, 0);
buffer[length] = 0; // adiciona terminador