You probably don't need to clear such buffer, anyway:
memset(recvbuf, 0, sizeof(recvbuf));
will do the job.
Tarun Batra wrote:
for(int j=0;j<=iResult;j++)
common[j]=recvbuf[j];
As already noted by
Graham Breach you are going to overrun the
common
buffer with such code.