And when char *opername=str(oper);

then o/p is oper....why behaviour is diff. in 2 cases

On Sun, Oct 28, 2012 at 2:53 PM, rahul sharma <[email protected]>wrote:

> #include<stdio.h>
> #include str(x) #x
> #define Xstr(x) str(x)
> #define oper multiply
>
>
> int main()
> {
> char *opername=Xstr(oper);
> printf("%s",opername);
> }
> so firstly     Xstr is expanded to str(oper)
> then str(oper) is expanded to #oper now i have read that
>
> If, however, a parameter name is preceded by a # in the replacement text,
> the
> combination will be expanded into a quoted string with the parameter
> replaced by the actual argument...and in this case actual is also oper so
> it becomes "oper"...so it should print oper .....i thnik i am mistaken
> anyhre...correct???
>

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

Reply via email to