Don't forget if you do this
char buff[100];
n = recv( sock, buff, sizeof buff, 0 );
buff[n] = '\0';

You will write past the end of the array if recv() actually succeeds in filling the buffer.
So if you're expecting characters and you want to leave room to append a \0, then do
n = recv( sock, buff, sizeof buff - 1, 0 );