Macro inside a string
- From: Sweta <swetag@xxxxxxxxx>
- Date: Fri, 31 Aug 2007 07:36:39 -0700
Hi,
I have the following code -
#include <stdio.h>
#define VAR i
main()
{
int VAR;
VAR = 10;
printf("VAR = %d", VAR);
}
As of now, this code prints VAR = 10
I want to have the output as i = 10 i.e. the macro replacement should
be printed as string. Does anybody have any idea how we can do it? Do
we have something like #, ## for macros which do not have argument
list.
Thanks,
Sweta
.
- Follow-Ups:
- Re: Macro inside a string
- From: Eric Sosman
- Re: Macro inside a string
- Prev by Date: Re: const qualifier - in declaration, definition or both?
- Next by Date: Re: Macro inside a string
- Previous by thread: const qualifier - in declaration, definition or both?
- Next by thread: Re: Macro inside a string
- Index(es):
Relevant Pages
|