Stringizing Operator and Pasting Operator
//stringizing operator : in this operater we doesnot use double code in printf"""
#include <stdio.h>
#define NAME(s) #s
int main()
{
printf( NAME(rohit parmar) );
return 0;
}
// pasting operator :
// this operator we use ## and it concat(add) the terms
#include <stdio.h>
#define CONCAT(a,b) a ## b
int main()
{
int xy = 23;
int pq = 20;
printf( "%d\n" , CONCAT(x,y) );
printf ("%d\n", CONCAT(p,q));
return 0;
}
Comments
Post a Comment