C alternative tokens
C alternative tokens refer to a set of alternative spellings of common operators in the C programming language. They are implemented as a group of macro constants in the C standard library in the
iso646.h header. The tokens were created by Bjarne Stroustrup for the pre-standard C++ language and were added to the C standard in a 1995 amendment to the C90 standard via library to avoid the breakage of existing code.
|C standard library|
The alternative tokens allow programmers to use C language bitwise and logical operators which could otherwise be hard to type on some international and non-QWERTY keyboards. The name of the header file they are implemented in refers to the ISO/IEC 646 standard, a 7-bit character set with a number of regional variations, some of which have accented characters in place of the punctuation marks used by C operators.
The above-mentioned identifiers are operator keywords in the ISO C++ programming language and do not require the inclusion of a header file. For consistency, the C++98 standard provides the header
<ciso646>. However the latter file has no effect, being empty. Some compilers, such as Microsoft Visual C++ have, at least in the past, required the header to be included in order to use these identifiers.
- "Grill the Committee 2018".
- "Rationale for International Standard - Programming Languages - C" (PDF). 5.10. April 2003. Archived (PDF) from the original on 2016-06-06. Retrieved 2010-10-17.
- Stroustrup, Bjarne (1994-03-29). Design and Evolution of C++ (1st ed.). Addison-Wesley Publishing Company. ISBN 0-201-54330-3.
- Lischner, Ray (2003). C++ in a Nutshell. O'Reilly Media. p. 212. ISBN 0-596-00298-X.