1.5 Alternative Tokens

Some symbols have multiple representations, as shown in Table 1-2. These alternative tokens have no special meaning in a character or string literal. They are merely alternative representations of common symbols. Most programmers do not use alternative tokens, especially the nonalphabetic ones. Some programmers find and, or, and not to be easier to read and understand than &&, ||, and !.

Table 1-2. Alternative tokens

Alternative token

Primary token

<%

{

%>

}

<:

[

:>

]

%:

#

%:%:

##

and

&&

and_eq

&=

bitand

&

bitor

|

compl

~

not

!

not_eq

!=

or

||

or_eq

|=

xor

^

xor_eq

^=

figs/acorn.gif

Many compilers do not support some or even all of the alternative tokens. In particular, some compilers do not treat alternative keywords (and, or, etc.) as reserved keywords, but allow you to use them as identifiers. Fortunately, this problem is becoming less common as more vendors hew closer to the standard. Compilers that do not support the alternative keywords might provide them as macros in the <ciso646> header. See Chapter 13 for more information.