1
I am receiving a buffer from the internet, I believe that to go through this buffer and find the last character, you need to find the character ' 0'. But there is no ' 0' in a buffer.
It is possible to force this buffer to behave like a string?
1
I am receiving a buffer from the internet, I believe that to go through this buffer and find the last character, you need to find the character ' 0'. But there is no ' 0' in a buffer.
It is possible to force this buffer to behave like a string?
2
Adds p '\0'
buffer. But attention to binary data!!
length = recv(socket, buffer, sizeof buffer - 1, 0);
buffer[length] = 0; // adiciona terminador
Browser other questions tagged c string buffer
You are not signed in. Login or sign up in order to post.