Oracle Solaris Studio 12.2:C++ 用户指南

示例

请考虑以下名为 trigraphs_demo.cc 的示例源文件。


#include <stdio.h>

int main ()
{
    (void) printf("(\?\?) in a string appears as (??)\n");
    return 0;
}

下面是使用 -xtrigraphs=yes 编译该代码后的输出。


example% CC -xtrigraphs=yes trigraphs_demo.cc
example% a.out
(??) in a string appears as (]

下面是使用 -xtrigraphs=no 编译该代码后的输出。


example% CC -xtrigraphs=no trigraphs_demo.cc
example% a.out
(??) in a string appears as (??)