Understanding Alternative Tokens: When Were 'and' and 'or' Introduced in C ?
In a recent discussion online, alternative tokens such as 'and' and 'or' were mentioned as potential alternatives to '&&' and '||'. Many programmers, including the questioner, were unaware of these alternative tokens. What exactly are they and when were they introduced in C ?
According to the C 98 ISO standard, alternative token representations have been available for select operators and punctuators since the inception of the C standardization process. As stated in Section 2.5 of the standard, these alternative tokens behave identically to their primary tokens, but with a different spelling.
The specific alternative tokens for 'and' and 'or' are '&&' and '||' respectively. These alternative tokens were introduced to provide compatibility in environments where the full character set might not be available. In the early days of computing, certain character sets did not include characters like '[' and ']', which led to the development of these alternative tokens as a workaround.
Despite their early introduction, alternative tokens like 'and' and 'or' have remained relatively unknown. This is likely due to the widespread availability of the full character set in modern computing environments, making the need for alternative tokens less common.
The above is the detailed content of What are the C alternative tokens 'and' and 'or,' and when were they introduced?. For more information, please follow other related articles on the PHP Chinese website!