Demonstrates the # operator in macro expansion. - C Preprocessor

C examples for Preprocessor:Preprocessor Operators

Description

Demonstrates the # operator in macro expansion.

Demo Code

#include <stdio.h>

#define OUT(x) printf(#x " is equal to %d.\n", x)

int main( void )
{
  int value = 123;
  OUT(value);//w  ww .  j a  v  a  2s. c  o m
  return 0;
}

Result


Related Tutorials