Stringizing Operator # ANSI C provides an operator # called stringizing operator to be used in the definition of macro functions. This operator converts a formal argument into a string. For example, if the macro is defined as follows: 1 #define sum(xy) printf(#xy “ = %f \n”, xy) and somewhere in the program the statement is written as: sum(a+b); then the preprocessor converts this line as shown below: 1 printf(“a+b” “ = %f \n”, a+b); Token Pasting Operator ## The token pasting operator ## defined by ANSI enables us to combine two tokens within a macro definition to form a single
The post What are Stringizing and Token Pasting Operators in C programming appeared first on Coding Security.
What are Stringizing and Token Pasting Operators in C programming
read more
Tidak ada komentar:
Posting Komentar