"?? *"C ++转义序列

编程入门 行业动态 更新时间:2024-10-13 10:24:00
本文介绍了"?? *"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 ++转义序列

本文发布于:2023-10-08 15:03:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1472974.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:序列   quot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!