4

Recently I came across a snippet similar to the following:

int a  <:20:>;
int b;
void foo()
<% 
 printf("Hello world"); 
 a <: ++b :> = 440;
%>

What C++ style/syntax does this belong to? Thanks for your answer.

SkypeMeSM
  • 3,197
  • 8
  • 43
  • 61

1 Answers1

5

They're called digraphs:

Digraph Equivalent
  <:         [
  :>         ]
  <%         {
  %>         }
  %:         #

They're supported because in some countries few symbols might not be present on their keyboards, so they can combine keys such as < and : to form equivalent of[, and so on. The wikipedia entry also describes trigraphs.

Nawaz
  • 353,942
  • 115
  • 666
  • 851