
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Trigraphs in C++
The ISO-646 character set does not have all the characters of the C syntax, therefore there are some systems with keyboards and displays that cannot deal with some characters. These characters can be constructed using a sequence of 3 characters called trigraphs. In C, 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.
trigraph | replacement | trigraph | replacement | trigraph | replacement |
---|---|---|---|---|---|
??= | # | ??( | [ | ??< | { |
??/ | \ | ??) | ] | ??> | } |
??’ | ˆ | ??! | | | ??- | ˜ |
They are there mostly for historical reasons. Nowadays, most modern keyboards for most languages allow access to all those characters, but this used to be a problem once with some European keyboards. This is why trigraphs were invented.
Advertisements