Digraphs and trigraphs

As a digraph is called in computer science is a combination of two characters, which are a substitute for a single character that is not in the character set you are using. Different programming languages ​​make use of this.

Digraphs in Pascal

In many compilers (* and * ) is not interpreted as a directed graph, but they mark a comment block style. A comment is started by (*, thus can not be terminated by }, and vice versa.

Digraphs in C and C

The use of digraphs (as well as of trigraphs ) is today regarded as obsolete, as is now supported on almost all platforms, the complete ASCII character set.

Since the digraph, however, are still defined in the language, this can lead to subtle and sometimes hard to find errors which will however be current compilers.

Example:

Std :: vector < std :: :: size_t > v; This can be solved by adding a space is inserted:

Std :: vector < std :: size_t ␣ :: > v; References

  • Programming language
239994
de