"?? *"C ++转义序列 [英] "??*" C++ escape sequence

查看:46
本文介绍了"?? *"C ++转义序列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请注意,标题中的 * 是占位符,在我的案例中,罪魁祸首是 ?? [.

Note that the * in the title is meant to be a placeholder, in my case the culprit was ??[.

我刚刚遇到了由双问号组成的C ++(也称为"C")转义序列.这曾经是做什么用的,为什么还在那里呢?

I just came over C++ (also "C") escape sequences, formed by double question marks. What was this ever used for and why is it still there?

我有 ascii-85 编码的文本,很少出现双问号,只是花了一个下午试图在编码器/解码器中发现错误时,将头发从我的头上扯下来,而仅仅是编译器在骗我.

I have ascii-85 encoded text where double question marks seldom occur and just spent an afternoon ripping the hair from my head while attempting to find a bug in the encoder / decoder, while it was simply the compiler playing tricks on me.

推荐答案

根据C ++标准

2.4 Trigraph序列[lex.trigraph]

2.4 Trigraph sequences [lex.trigraph]

1在进行任何其他处理之前,以下三个字符序列之一(三字序列")的每次出现都被表1中所示的单个字符代替.表1 — Trigraph序列Trigraph替换Trigraph替换Trigraph替换

1 Before any other processing takes place, each occurrence of one of the following sequences of three characters ("trigraph sequences") is replaced by the single character indicated in Table 1. Table 1 — Trigraph sequences Trigraph Replacement Trigraph Replacement Trigraph Replacement

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

但是,您显示的 ?? * 符号不是三部曲符号.因此很难说出它的意思.

However the symbol you showed ??* is not a trigraph symbol. So it is difficult to say what it means.

看来我已经明白了什么意思了.它们是通配符? * ,只是在字符串文字符号?中加倍了::)

It seems I have understood what it means. They are wild characters ? and * Simply inside a string literal symbol ? was doubled.:)

这篇关于"?? *"C ++转义序列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆