I want to understand this bit of code
#define GET(p) (*(unsigned int*) (p))
I learned about pointers but I can't figure out what the statement above means. When I use GET(ptr), am I getting the value at the address ptr points to or the address that ptr contains?
It means the following.
p
to the type unsigned int*
. Another way of putting it is that the macro gets the value of the unsigned int
at the address specified by p
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.