"x01" [0] 为什么字符串末尾存在 [0]
"x01"[0] Why at the end of the string is present [0]
我在很多论坛上搜索过,但没有找到问题的答案:
我正在尝试了解我的3D打印机(Marlin固件)中的软件,我找到了这个c ++代码:
#define LCD_STR_BEDTEMP "x00"
#define LCD_STR_DEGREE "x01"
#define LCD_STR_THERMOMETER "x02"
#define LCD_STR_UPLEVEL "x03"
#define LCD_STR_REFRESH "x04"
#define LCD_STR_FOLDER "x05"
#define LCD_STR_FEEDRATE "x06"
#define LCD_STR_CLOCK "x07"
#define LCD_STR_ARROW_RIGHT "x7E" /* from the default character set */
lcd.createChar(LCD_STR_BEDTEMP[0], bedTemp);
lcd.createChar(LCD_STR_DEGREE[0], degree);
lcd.createChar(LCD_STR_THERMOMETER[0], thermometer);
lcd.createChar(LCD_STR_UPLEVEL[0], uplevel);
lcd.createChar(LCD_STR_REFRESH[0], refresh);
lcd.createChar(LCD_STR_FOLDER[0], folder);
lcd.createChar(LCD_STR_FEEDRATE[0], feedrate);
lcd.createChar(LCD_STR_CLOCK[0], clock);
lcd.createChar
Arduino 命令我没有问题,但我不明白的部分是为什么所有#define
字符串都以 [0] 结尾?
感谢您的任何帮助。
所有宏都会生成始终以 \0 结尾的字符串文字。请出示lcd.createChar
功能的签名。也许会更清楚问题是什么。
相关文章:
- 将文件复制到自定义位置,存在字符串转换问题
- 我遇到了这个代码片段,不明白. 它递归检查 C++ 字符串中是否存在大写字符
- 有没有办法将字符串添加到 Vector 中,但前提是它尚不存在?->C++
- C++ 查找字符串中存在的元素向量
- 与C++中的空字符串相比,突变仍然存在?
- 将字符串转换为整数类型T,检查是否存在溢出
- 如何检查二进制文件中是否存在字符串
- 是否存在像C++中那样带有分隔符的C#原始字符串
- 在向量中存储字符串存在 SEG 错误
- 给定字符串和单词 S 的列表,检查列表中是否存在 S
- 除了字符串或宏调用之外,是否存在任何情况,其中"(<"是有效的字符流?
- 查找字符串中存在的不同字符
- C++实现代码中的字符串不应存在于输出二进制文件中.如何解决
- 控制一个字符串是否存在于另一个字符串中(以 C++ 为单位)
- 阵列不能两次将相同的名称保存,当要添加新字符串时,程序应检查以查看该名称是否已经存在
- C 验证字符串2中是否存在字符串1
- 什么是最快检查字符串数组中是否存在字符串的方法
- 如何知道基于项目的ListView QT C 中是否存在字符串
- 检查数组中是否存在字符串
- 如果存在字符串,则设置bool值