PDA

View Full Version : Allocating memory



Bsbosa.com
07-15-2010, 09:41 PM
Hey, this is my code:
char szBuffer[1024];
recv(sock,szBuffer,sizeof(szBuffer),NULL);
printf("%s", szBuffer);
now the size of the websites vary, how would i allocate just enough memory for the actual content so the rest of the buffer wont be filled with junk ?
Thanks.