Re: pre-processor string replacement



sam_cit@xxxxxxxxxxx wrote:

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


What did you expect to see?

--
Ian Collins.


i expect first statement to replace status of second statement with
23, so it would be

#define "23" "43"...

which isn't the case, so i though string replacement never happens in
pre-processor statement, however the second example i pointed proves
that understanding is not correct.

I see. In the first example you are redefining status (your compiler
did warn you, didn't it?).

--
Ian Collins.
.



Relevant Pages