The first sentence is correct. The second two incorrect for the code in the original question. The problem occurs because of the locally declared char Buffer[1024]; and the InternetReadFile(handle, Buffer, sizeof(Buffer), &dwRead). The given Buffer in fact cant be terminated without potential loss of characters read because it has been potentially completely filled by the InternetReadFile. To correctly terminate the Buffer for later appending to a CString would require a Buffer[dwRead] = '\0'; where for most iterations of the loop dwRead = 1024, which would either invalidate one of the other local variables or corrupt the stack in some other way. The correct way would be InternetReadFile(handle, Buffer, sizeof(Buffer)-1, &dwRead) and then a Buffer[dwRead] = '\0'; inside the while loop.