Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
Stringizing Operator
◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
Operator: #
Syntax: #parameter
Summary: The stringizing operator, used only with the arguments of
macros. If a # precedes a formal parameter in the
definition of the macro, the actual argument is enclosed
in double quotes and treated as a string when the macro is
expanded. The resulting string is concatenated with
adjacent strings. For example,
#define debug(x) printf(#x " = %d\n",x)
causes the statement
debug(width);
to be expanded into
printf("width = %d\n",width);
White space between tokens in the actual argument is
ignored. If the argument contains characters that normally
must be preceded by a backslash (\) when appearing in a
string (such as " or \), the backslash is automatically
inserted.
-♦-