这个问题已经占用了我一整天,我不知道为什么会这样。我的代码:
char products[11][14]= { {'6','3','4','4','8','2','7','0','1','9','2','~','~'},
{'5','0','6','0','1','8','5','1','6','2','3','7','0'},
{'0','1','2','3','4','5','6','7','8','9','0','1','2'},
{'6','7','1','8','6','0','0','1','2','3','2','0','~'},
{'1','8','8','3','3','4','0','0','1','4','~','~','~'},
{'7','0','5','1','0','5','2','2','1','5','1','9','~'},
{'9','7','8','8','4','2','0','5','3','2','3','1','8'},
{'1','2','5','0','0','2','7','4','1','3','5','~','~'},
{'8','1','1','2','0','4','0','1','2','3','4','4','~'},
{'5','9','4','4','5','2','5','0','0','2','3','6','9'},
{'9','7','8','9','7','3','1','0','3','0','4','1','8'}
};
void setup(){
Serial.begin(9600);
for(int i=0; i<11; i++){
for(int j=0; j<14; j++)
Serial.print(products[i][j], DEC);
Serial.println("\n");
}
}
void loop(){}
当我运行它时,它不会打印我存储的实际值,而是打印:
54515252565055484957501261260
534854484956534954505155480
484950515253545556574849500
5455495654484849505150481260
495656515152484849521261261260
5548534948535050495349571260
575556565250485351505149560
49505348485055524951531261260
5649495048524849505152521260
535752525350534848505154570
575556575551494851485249560
起初我认为这是每个人的 ASCII 码,但我的值应该在 30 到 39 之间。那是什么以及如何获得实际值?