问题 In the following snippet, I receive the data until I have completely received all the data from the socket client. I keep on storing the data in a char buffer of size 300. ssize_t b; char buffer[300] while((b = recv(socket_fd,buffer,sizeof(buffer))) > 0) { // keep on receiving the data } But the problem is on each iteration, buffer gets refilled and old values are lost. How do I concatenate the buffer values into one, so that at the end of the loop I get the message as one complete string?