Original Post
Wow, am I ever confused.
I''m writing a compiler for a custom syntax and I ran into an interesting phenominon that I find incredably odd.
I have a variable that is pointing to memory dynamically allocated using Kernel32.dll''s HeapAlloc(). When I typecast the pointer to another variable the new variable points to a different location in memory.
Why does it do that?
void *pValue = HeapAlloc(ph, HEAP_ZERO_MEMORY, size ); // pValue == 0x04a4295c char *pCharValue = (char*)pValue; // pCharValue == 0x00173C83 // Shouldn''t pValue == pCharValue like it would if I were to do the same thing in C++?
