便便代码人生

关注技术, 偶尔动动手

[晕] 居然还有这种东西:C++ Trigraph

Posted by bianbian on 2007-08-01 03:34


本文Tags:

听说为了照顾某些键盘坏了又换不起的,可以使用这种3字符的串来代替一些特殊字符,preprocess的时候会替换掉:

#: ??=
\: ??/
^: ??’
[: ??(
]: ??)
{: ??<
}: ??>
|: ??!
~: ??-

于是程序就这样了:

  1. //: S03:trigraph.cpp
  2. ??=include <iostream>
  3.  
  4. int main(int argc, char* argv??(??)) ??<
  5.     using namespace std;
  6.     unsigned int n;
  7.     if (argc != 2 ??!??! (n = atoi(argv??(1??))) <= 0)
  8.         return 1;
  9.     cout << ??-(n ??' 0xf0f0) << '??/n';
  10.     return 0;
  11. ??>

我就奇怪了,键盘换不起,眼睛换换就那么便宜吗?

标签:

遵守创作共用协议,转载请链接形式注明来自http://bianbian.org 做人要厚道

相关日志

Posted in C/C++, Technology | 2 Comments »