Hi all,
First I create a dynamic buffer and set all element to zero. Then add a int value first to the buffer. Then after that int value add a string to the buffer, actually at the end of int value. But seems my code overwrite each other.
Here is the code,
char* tmpBuffer = new char[10];// Dynamic allocation
::memset(tmpBuffer, 0, 10);
::memcpy(tmpBuffer, &iReq, 4);
::memcpy(tmpBuffer, &strGetName, 6);
How can I avoid this issue.