UB26⚓︎
Author: Tianlin Xiao.
Content⚓︎
An unmatched ’ or " character is encountered on a logical source line during tokenization (6.4)
Description⚓︎
当在一个逻辑行中出现了未匹配的'
和"
字符串时,结果未定义。逻辑行:可以使用反斜杠符号\
来连接物理行以创建逻辑行。当一行代码太长无法适合单个物理行时,可以使用反斜杠符号将其连接到下一行,以形成一个逻辑行。例如:
#include <stdio.h>
int main() {
int a = 5, b = 10, c = 15, d = 20;
int sum = a + b + \
c + d;
printf("Sum = %d", sum);
return 0;
}