Stringizing Operator

The stringizing operator can only appear in a preprocessor directive. It consists of a single number sign:

	#

when it precedes a macro, i.e. #define, formal parameter IN the body of the preprocessor macro, it causes that actual argument to be enclosed in string quotation marks. For example:

	#define string(z)  #z

when used as:

	int temperature=72;
	printf("%s=%d\n",string(temperature),temperature);

will print:

	temperature=72

© 1991-2008 Prem Sobel. All Rights Reserved.