|
-
November 21st, 2009, 11:59 AM
#1
[RESOLVED] Aligning pointers to struct
Hi,
I have two structs and I would like to assign a pointer from t_TMSG to an address in t_TAG.
But the problem is i dont get the correct address.
typedef struct {
WORD tag;
WORD opr;
DWORD unit;
LPCTSTR text;
} t_TAG;
typedef struct {
long tag;
LPCTSTR text;
} t_TMSG;
t_TAG* pTag = SomeFunction(); //assuming pTAg is loaded with values
t_TMSG *pTMsg = (t_TMSG*)(pTag + sizeof(WORD) + sizeof(WORD) ); // i get the wrong address here.
Please help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|