Pointer made from an integer in C on an embedded platform

北城余情 提交于 2019-12-01 15:10:15

问题


I came across the follow line of code:

    #define ADCA (*(volatile ADC_t*)0x200)

It is for embedded C code for an AVR microcontroller. ADC_t is a union.

I know that (volatile ADC_t*)0x200 its a pointer to an absolute memory address but I am still not quite sure what the first * means.


回答1:


That first * dereferences the pointer. In other words ADCA is the contents of the memory at 0x200.



来源:https://stackoverflow.com/questions/7522351/pointer-made-from-an-integer-in-c-on-an-embedded-platform

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!