Re: copy structure to unsigned char
- From: Bill Medland <billmedland@xxxxxxx>
- Date: Thu, 28 Sep 2006 20:35:19 GMT
Ravi wrote:
Hi,Huh? Truly?
I need to copy a nested structure (structures having multiple
structures) into a unsigned char
array. I cannot use memcpy as our micro doesnt support it.
I know the way to do is field by field copy of each structure members,Perhaps you could ask in a group that addresses the language or your micro
but then is there a
general algo / code which does this field by field copy ???? (Should
not have padding bytes)
My sample structure looks like this ->
struct temp {
struct t1;
struct t2;
struct t3;
..
..
char f[10];
};
I would be grateful if anybody shares me a generic code to do the
above,.
thanks
ravi
OS.
If it is C can you not do it by casting?
const unsigned char *p = (unsigned char *)(&mytemp);
--
Bill Medland
.
- References:
- copy structure to unsigned char
- From: Ravi
- copy structure to unsigned char
- Prev by Date: Where do I go from here?
- Next by Date: Re: file info
- Previous by thread: copy structure to unsigned char
- Next by thread: Where do I go from here?
- Index(es):
Relevant Pages
|