数组、变量基础问题求组!
如下我要改变数组里面的值,通过改变变量来实现,采用如下方式可否const byte DD1=0x7E;
const byte DD2=0x7E;
const byte DD3=0x7E;
const byte DD4=0x7E;
const byte DD5=0x7E;
const byte DD6=0x7E;
const byte DD7=0x7E;
const byte DD8=0x7E;
const byte DD9=0x7E;
const byte DD10=0x7E;
const byte mybuf[] = {DD1,DD2,DD3,DD4,DD5,DD6,DD7,DD8,DD9,DD10};
Serial.write(mybuf,sizeof(mybuf) / sizeof(mybuf));
我输出的是不是: 7E 7E7E 7E7E 7E7E 7E 7E 7E 不要用 DD1, DD2, .... 系統中本身已定義了, 有別的用途. Super169 发表于 2014-10-20 11:40 static/image/common/back.gif
不要用 DD1, DD2, .... 系統中本身已定義了, 有別的用途.
变量名可以换,但是怎么动态改变数组里面的值呢? LINK~ 发表于 2014-10-20 17:26 static/image/common/back.gif
变量名可以换,但是怎么动态改变数组里面的值呢?
不好意思, 不太明白.
动态改变数组里面的值 <- 這句是什麼意思?
既然設定為 const, 為何又要動態改變數值?
页:
[1]