W
Wenjie
Hello,
I have an array: unsigned char a[1024];
I want to copy some data into it:
memcpy(a, anotherArray, sizeof(a));
But I saw somebody is using this:
memcpy(&a, anotherArray, sizeof(a));
And it passed the tests (VC++6.0).
Could someone confirm me that the 2nd use of
of &a is not valid? Why?
Also I would think it is OK to do:
memcpy(&a[0], anotherArray, sizeof(a));
Best regards,
Wenjie
I have an array: unsigned char a[1024];
I want to copy some data into it:
memcpy(a, anotherArray, sizeof(a));
But I saw somebody is using this:
memcpy(&a, anotherArray, sizeof(a));
And it passed the tests (VC++6.0).
Could someone confirm me that the 2nd use of
of &a is not valid? Why?
Also I would think it is OK to do:
memcpy(&a[0], anotherArray, sizeof(a));
Best regards,
Wenjie