指针由嵌入式平台C中的整数构成 [英] Pointer made from an integer in C on an embedded platform

查看:164
本文介绍了指针由嵌入式平台C中的整数构成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了以下代码行:

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

它用于AVR微控制器的嵌入式C代码。 ADC_t 是一个联合。

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

我知道(volatile ADC_t *)0x200 它指向绝对内存地址的指针,但我仍然不太清楚第一个 * 是什么意思。

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.

推荐答案

第一个 * 取消引用指针。换句话说, ADCA 0x200 内存的内容。

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

这篇关于指针由嵌入式平台C中的整数构成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆