Explaing Preprocessor Symbol ‘#’


The # symbol can be used in front of a normal macro argument to convert the actual argument to string.

#define PRINT(X) printf ( #X ” = %s”, X ) ;

void main( )

{

char *name = “Jeff Prosise” ;

PRINT ( name )

}

The output of the above program is

name = “Jeff Prosise”

Subscribe / Share

It's very calm over here, why not leave a comment?

Leave a Reply




Categories

Powered by Yahoo! Answers