Re: pre-processor string replacement



On 14 Jan 2007 00:10:18 -0800, in comp.lang.c , 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"...

No, the preprocessor doesn't work like that. All you've done is
redefine status.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
.



Relevant Pages

  • Re: pre-processor string replacement
    ... Ian Collins. ... i expect first statement to replace status of second statement with ... In the first example you are redefining status (your compiler ...
    (comp.lang.c)
  • Re: [PHP] Re: whats the difference in the following code?
    ... In the first statement $search would either be set to $_GET ... whereas in the second statement $search would only ... or an empty string if it does not. ... Application and Templating Framework for PHP ...
    (php.general)
  • Re: [PHP] Re: whats the difference in the following code?
    ... In the first statement $search would either be set to $_GET ... whereas in the second statement $search would only ... or an empty string if it does not. ...
    (php.general)
  • Re: Exe Weirdness
    ... >> Shouldn't the first argument of the second statement be fileYear and ... >> currCDKFile? ... the first statement is having no effect. ... > Still doesn't explain the mysterious disappearing 'Invalid Property' ...
    (microsoft.public.vb.general.discussion)
  • Re: OT CNN calls Florida Republican Primary for McCain
    ... Her first statement is irrelevent to the discussion until she ties it to ... second statement. ... YOU being a shit for brains completely misinterpreted how her second ...
    (rec.gambling.poker)