Two letters combined into one composite one, such as ae or oe, or various vowels and even a few consonants with an accent or a tilde. AEneas was a phoenecian, so he never ate jalapen~os. Everything needs to support digraphs. Blah.

In graph theory, a digraph is a directed graph. The same as a graph, except elements of the edge set are ordered pairs, not unordered pairs.

If (a,b) is an edge the edge (b,a) doesn't necessarily exist.
Digraphs are two-character punctuation tokens in programming languages that can replace a single character. They are usually used to write certain characters not present in older character maps (most notably ISO-646).

Pascal introduced the idea of digraphs. It defined a small set of digraphs to get around the problematic brackets and curly braces. Pascal defines the following digraphs:

  • (* means {
  • *) means }
  • (. means [
  • .) means ]

The 1999 revision of ISO C (C99) and ISO C++ define a set of digraphs, in addition to the standard C90 trigraphs. The digraphs were added to the standards due complaints that the original trigraphs were ugly and hard to read. The digraphs provide only a slight improvement. The digraphs accepted in C are:

  • <% means {
  • %> means }
  • <: means [
  • :> means ]
  • %: means #
  • %:%: means ##
Here is a sample with trigraphs:
??=include <stdio.h>

int main(int argc, char *argv??(??)) ??<
    printf("Hello World??/n");
??>

And now with digraphs:

%:include <stdio.h>

int main(int argc, char *argv<: :>) <%
    printf("Hello World??/n");
%>

Maybe a little bit better, but it hardly seems worth the effort.

Di"graph (?), n. [Gr. = twice + a writing, to write.]

Two signs or characters combined to express a single articulated sound; as ea in head, or th in bath.

 

© Webster 1913.

Log in or register to write something here or to contact authors.