

##                    Preprocessing Operator                   ##




Token-pasting operator


The preprocessing operator ## can be used in both object-like and
function-like  macros.   When  used  immediately  before  or  im-
mediately after  an element in  the macro's replacement  list, ##
joins  the corresponding  preprocessor token  with  its neighbor.
This is sometimes called ``token pasting''.

As an example of token pasting, consider the macro:


        #define printvar(number) printf("%s\n", variable ## number)


When the preprocessor reads the following line


        printvar(5);


it substitutes the following code for it:


        printf("%s\n", variable5);


The  preprocessor throws  away all  white  space both  before and
after the ##  operator.  This gives you an easy  way to print any
one of a set of strings.

## must not  be used as the first or  last entry in a replacement
list.  All instances of  the ## operator are resolved before fur-
ther macro replacement is performed.

For more information on object-like and function-like macros, see
#define.

***** See Also *****

#, #define, C preprocessor

***** Notes *****

Token pasting  has been performed by separating  the tokens to be
pasted with an empty comment, but this is no longer necessary.

The order of evaluation of multiple ## operators is unspecified.








COHERENT Lexicon                                           Page 1


