【发布时间】:2021-02-01 00:26:55
【问题描述】:
我有一个全局变量
int CYCLE0;
我想插入一个很长的 snprintf 语句的中间。
snprintf(temp, 400,
"<html>\
<head>\
<meta http-equiv='refresh' content='5'/>\
<title>ESP32 Demo</title>\
<style>\
body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }\
</style>\
</head>\
<body>\
<h2>Turn on</h2> \n\
<p>cycled "CYCLE0" times</p> \n\"
);
收到错误:
unable to find string literal operator 'operator""CYCLE0' with 'const char [1118]', 'unsigned int' arguments
如何在 snprintf 语句中间插入一个整数变量?
【问题讨论】:
标签: c arduino printf string-literals