Arduino中的引用和解引用运算符
引用 (&) 和解引用 (*) 在 Arduino 中的运算符类似于 C。引用和解引用与指针一起使用。
如果 x 是一个变量,那么它的地址由&x表示。
类似地,如果p是指针,那么p指向的地址中包含的值由&p表示。
示例
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println();
int x = 10;
int *p;
p = &x; //p now contains the address of x
Serial.print("The value stored in the address pointed by p is: ");Serial.println(*p);
}
void loop() {
// put your main code here, to run repeatedly:
}输出
串行监视器输出 −

广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP