![]() |
memcpy() and uint8_t
Hello folks..
In the following code, I m trying to copy struct element to array... Code:
#include<iostream>x =19 d= d2= d= d2= I ve replaced uint8_t and uint32_t by datatype 'int' and it works well... i can display contents of 'd' but not for uint8_t and uint32_t . Please suggest me how can i check whether data successfully copied to destination? Thank You |
Re: memcpy() and uint8_t
I'm not sure what you are doing, but it might be a packing issue. By default, MS compilers line-up data in structure to an 8 byte boundary (makes it easier on the memory controller). You can override this behavior with the #pragma pack option:
Code:
|
Re: memcpy() and uint8_t
I want to copy struct test (except struct header) and struct test2 on to array pointed by 'd'
I 'd put printf() to display *d instead of cout... its working Thanks for early reply Quote:
|
| All times are GMT +5.5. The time now is 20:38. |