C examples for Preprocessor:Preprocessor Operators
# operator turns the argument it precedes into a quoted string. For example, consider this program:
#include <stdio.h> #define mkstr(s) # s//from w w w. j a v a2 s. c om int main(void) { printf(mkstr(I like C)); return 0; }
## operator concatenates two tokens. For example:
#include <stdio.h> #define concat(a, b) a ## b//w ww.j a v a 2s. c o m int main(void) { int xy = 10; printf("%d", concat(x, y)); return 0; }