On Aug 24, 6:51 pm, sadhana kumar <sadhanakuma...@gmail.com> wrote:
> Can anyone explain this code pls??
>
> #include <stdio.h>
> #define f(a,b) a##b
> #define g(a) #a
> #define h(a) g(a)
> int main()
> {
> printf("%s\n",h(f(1,2)));
> printf("%s\n",g(f(1,2)));
> return 0;
>
>
>
>
>
>
>
> }

Read about stringizing operator (#) and token pasting operator (##),
if you don't know them already.
Then, please go through the following link to understand the above
code:
http://gcc.gnu.org/onlinedocs/cpp/Argument-Prescan.html#Argument-Prescan

In particular, read the second point: "Macros that call other macros
that stringify or concatenate."

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to