I have a variable
UInt32 PageAddr = 0x80000000;
and a function
UInt8 Blank_Check(const UInt8 *Address)
I am calling the function after typecasting variable.
Blank_Check((UInt8 *)&PageAddr);
What will be the value that will be passed to the blank check. I tried to analyze but I am unable to understand how it works?
Short version: remove the
&character.Longer version:
It will be exactly the same pointer value. The type is only there to help the C compiler know how to index and dereference the pointer.
To clarify the difference between value and pointer, try:
By the name of variable, I guess you really want to do something like:
Or if you want to keep the pointer represented as an integer (works on almost all platforms, but is not 100% portable), like this: