trigraphs

Are digraphs and trigraphs in use today? [closed]

╄→гoц情女王★ 提交于 2019-11-28 22:25:08
Given that there were once reasons to use digraphs and trigraphs in C and C++, does anyone put them in code being written today? Is there any substantial amount of legacy code still under maintenance that contains them? (Note: Here, "digraph" does not mean "directed graph." Both digraph and trigraph have multiple meanings, but the intended use here are sequences like ??= or <: to stand in for characters like # and [ ) There is a proposal pending for C++1z (the next standard after C++1y will be standardized into -hopefully- C++14) that aims to remove trigraphs from the Standard. They did a case

meaning of `???-` in C++ code [duplicate]

戏子无情 提交于 2019-11-28 22:14:18
This question already has an answer here: What does the C ??!??! operator do? 4 answers I saw the following code from some legacy codes: size_t a = 1 ???- 2 :0; What does the symbol ???- mean in C++? How should I understand it? Thank you! It's actually: size_t a = 1 ? ~2 :0; ??- is a trigraph for ~ Trigraphs are from an old era... before some of us were even born. Back in the days, there were some characters that weren't always supported. An unknowing programmer would try to type in such a character only to find that it doesn't exist on the keyboard! Image Source: http://www.myoldmac.net/cgi

Are digraphs and trigraphs in use today? [closed]

微笑、不失礼 提交于 2019-11-27 20:55:14
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . Given that there were once reasons to use digraphs and trigraphs in C and C++, does anyone put them in code being written today? Is there any substantial amount of legacy code still under maintenance that contains them? (Note: Here, "digraph" does not mean "directed graph."

meaning of `???-` in C++ code [duplicate]

北城以北 提交于 2019-11-27 14:28:43
问题 This question already has an answer here: What does the C ??!??! operator do? 4 answers I saw the following code from some legacy codes: size_t a = 1 ???- 2 :0; What does the symbol ???- mean in C++? How should I understand it? Thank you! 回答1: It's actually: size_t a = 1 ? ~2 :0; ??- is a trigraph for ~ Trigraphs are from an old era... before some of us were even born. Back in the days, there were some characters that weren't always supported. An unknowing programmer would try to type in such

What does the C ??!??! operator do?

巧了我就是萌 提交于 2019-11-26 21:11:53
I saw a line of C that looked like this: !ErrorHasOccured() ??!??! HandleError(); It compiled correctly and seems to run ok. It seems like it's checking if an error has occurred, and if it has, it handles it. But I'm not really sure what it's actually doing or how it's doing it. It does look like the programmer is trying express their feelings about errors. I have never seen the ??!??! before in any programming language, and I can't find documentation for it anywhere. (Google doesn't help with search terms like ??!??! ). What does it do and how does the code sample work? user786653 ??! is a

Purpose of Trigraph sequences in C++?

◇◆丶佛笑我妖孽 提交于 2019-11-26 18:25:14
According to C++'03 Standard 2.3/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. ---------------------------------------------------------------------------- | trigraph | replacement | trigraph | replacement | trigraph | replacement | ---------------------------------------------------------------------------- | ??= | # | ??( | [ | ??< | { | | ??/ | \ | ??) | ] | ??> | } | | ??’ | ˆ | ??! | | | ??- | ˜ | ---------------------------------------------

When were the &#39;and&#39; and &#39;or&#39; alternative tokens introduced in C++?

感情迁移 提交于 2019-11-26 02:03:03
I've just read this nice piece from Reddit. They mention and and or being "Alternative Tokens" to && and || I was really unaware of these until now. Of course, everybody knows about the di-graphs and tri-graphs , but and and or ? Since when? Is this a recent addition to the standard? I've just checked it with Visual C++ 2008 and it doesn't seem to recognize these as anything other than a syntax error. What's going on? MSVC supports them as keywords only if you use the /Za option to disable extensions; this is true from at least VC7.1 (VS2003). You can get them supported as macros by including

When were the &#39;and&#39; and &#39;or&#39; alternative tokens introduced in C++?

家住魔仙堡 提交于 2019-11-26 01:08:32
问题 I\'ve just read this nice piece from Reddit. They mention and and or being \"Alternative Tokens\" to && and || I was really unaware of these until now. Of course, everybody knows about the di-graphs and tri-graphs, but and and or ? Since when? Is this a recent addition to the standard? I\'ve just checked it with Visual C++ 2008 and it doesn\'t seem to recognize these as anything other than a syntax error. What\'s going on? 回答1: MSVC supports them as keywords only if you use the /Za option to