Re: Problem with VS and memcpy...

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Paolo wrote:
The excat code is:

int number = 25;
int offSet = 16000;
unsigned char header[8];
header[0] = 0;
header[1] = 255;
header[2] = 0;
header[3] = number>>8;
header[4] = number;
header[5] = offSet>>16;
header[6] = offSet>>8;
header[7] = offSet;

memcpy(buffer, header, sizeof header);

If you want to see the contents of "buffer" after you copy something
to it, regardless of the zeroes you may, or may not, have written to
it, put something like this in your watch window:

buffer,8

Put a break point just after the memcpy() and then look at the watch
window. You will be able to expand "buffer,8" to view the first
eight entries. This can help you view the contents of any buffer.

Murrgon
.