how do i clean out a buffer?
i have a char *buffer and an int recmsgleng.
recmsgleng is set to 256.
the client connects to a server and is supposed to receive data of the size 256 bytes.
so i used the recv(sockfd, buffer, recmsgleng, 0) call.
when the data is received i called printf to print the variable
contents to the screen.
when nothing is received, there is still something in the buffer. it prints some strange symbols to the screen.
i wanted to clean out the buffer, in order to prevent printing these strange symbols.
how would i do that?