Re: pre-processor string replacement



sam_cit@xxxxxxxxxxx wrote:
Hi Everyone,

I have the following question regarding string replacement
pre-processor statement,

#define status "23"
#define status "44"

int main()
{
printf("%s\n", status);
}

this works fine and prints 44

where as

#define status "23"
#define status1 status

int main()
{
printf("%s\n", status);
}

prints 23, string replacement occurs on the pre-processor statement
itself, which is not in case 1, why is it so?
Can anyone help me on this?

What did you expect to see?

--
Ian Collins.
.



Relevant Pages

  • Re: pre-processor string replacement
    ... I have the following question regarding string replacement ... int main ... rjh at the above domain, ...
    (comp.lang.c)
  • pre-processor string replacement
    ... I have the following question regarding string replacement ... int main ... #define status1 status ... string replacement occurs on the pre-processor statement ...
    (comp.lang.c)