614| 1
|
[ESP8266/ESP32] 进一步熟悉nullptr |
程序写入ESP32C3以后,串口吐的内容是 emptyString payload: request to all devices on the bus emptyString payload: request to all devices on the bus emptyString payload: request to all devices on the bus #define emptyString F("") 定义空字符串 foo(const char *payload = nullptr) 定义入参payload,默认值是nullptr foo(); 让入参使用默认值,打印emptyString foo("request to all devices on the bus"); 打印payload: request to all devices on the bus 对语法记不清,最好是写出来验证一下 |
有兴趣可以运行下这个代码,有没有什么问题呢? |
© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed