Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在经历几个面试问题,我遇到了如下示例。我尝试了简单输入/输出以及一些逻辑的示例,它可以正常工作。
??=include <stdio.h> int main(void) ??< printf("Hello"); // Other code lines here return 0; ??>
令我惊讶的是,这没有任何编译问题,并且输出符合要求。
'??=', '??<' 和 '??>' 这里的意义是什么?
??=将替换为#,
??=
#
??<将替换为{,
??<
{
??>将替换为},
??>
}
由预处理器。这些被称为三元组。共有9个三字组;其他是:
??(将替换为[,
??(
[
??)将替换为],
??)
]
??/将替换为\,
??/
\
??'将替换为^,
??'
^
??!将替换为|,
??!
|
??-将替换为~.
??-
~
在源代码被标记化之前,三元图在翻译过程的早期就被处理了。它们会影响注释、字符串和字符文字。