What are C-digraphs?

6

Based on the trigraphs question, what are digraphs?

  • Why were they created?
  • What are the sequences?
  • Do the current compilers still allow you to use them?
asked by anonymous 18.12.2015 / 21:43

1 answer

6

I wish I had not asked: P

The early days of computers encountered difficulties in entering certain types of characters. Then these sequences of characters were created to represent another one that really should have been "typed" there. Something similar to what you do with Unicode nowadays in certain situations where you can not easily enter the character.

According to Wikipedia would be these sequences:

<:  ->  [
:>  ->  ]
<%  ->  {
%>  ->  }
%:  ->  #

Trigraphers

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

In general the compilers allow. C ++ wants to get this out of specification .

Better not to use. There is no reason for this nowadays. You have a example here .

    
18.12.2015 / 21:54