|
-
February 12th, 2004, 05:09 AM
#1
__int64 weirdness....
Suppose you have a function that requires a long pointer to a DWORD - e.g.
void SomeFunc (LPDWORD data)
{
. . .
}
Now suppose you call it with the address of WORD - e.g.
WORD myData = 210;
SomeFunc (&myData);
The above produces a compiler warning and SomeFunc(...) receives corrupted data. You can overcome this using a cast - e.g.
WORD myData = 210;
SomeFunc ((LPDWORD)&myData);
Here's my question. WORD is an unsigned int, DWORD is an unsigned 32 bit int - so why doesn't this work for an unsigned 64 bit int - e.g.
void SomeFunc (unsigned __int64 *data)
{
. . .
}
DWORD myData = 210;
SomeFunc ((unsigned __int64 *)&myData);
In the above example, SomeFunc(...) still receives corrupted data. Why
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
|