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

Originally Posted by Gene Poole View Post
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:

#pragma pack(push,1)
struct test
	struct header
		int a;
		int b;
	uint8_t c;
	uint8_t d;
	uint8_t e;
	uint32_t f;
struct test2
	uint8_t n;
	uint8_t m;
	uint8_t p;
#pragma pack(pop)