Re: I cant do change string to int.



In article <871wawzm9a.fsf@xxxxxxxxx>, Ben Bacarisse
<ben.usenet@xxxxxxxxx> wrote on Sunday 11 Nov 2007 11:40 pm:

santosh <santosh.k83@xxxxxxxxx> writes:

In article <1194802445.381563.324660@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
emre esirik(hacettepe computer science and engineering)
<emreesirik@xxxxxxxxx> wrote on Sunday 11 Nov 2007 11:04 pm:
int z=0;
<snip>
z=1;
<snip>
this is my code, I want to enter like this 3X^1+32X^4+12X^0 but
its
only do if part which if z==0 but why it doesnt do 'else' part????

Because 'z' is always zero. You initialise it to zero but no other
code changes it, so the if part of the if/else statement is always
executed.

there is a 'z=1;' in there. Proof, if it were needed, that good names
and good layout are important. The code is uninviting so I have not
had a look at it.

Ah yes. Good spot. However it comes _after_ the if/else construct so
it's of no consequence to it.

.



Relevant Pages

  • Re: I cant do change string to int.
    ... esirik(hacettepe computer science and engineering) ... only do if part which if z==0 but why it doesnt do 'else' part???? ... Because 'z' is always zero. ...
    (comp.lang.c)
  • Re: Allow Zero Length in ADO with VB6
    ... I set the Allow Zero Length to True, but it still doesnt show up in my ... Are you confusing zero-length strings with null ("required" ... Please reply to the newsgroup. ...
    (microsoft.public.data.ado)
  • Re: XP Installation problem (Data error cyclic redundancy check)
    ... Your version of winxp doesnt have big lba enabled ... installing xp on it now so there u go... ... manufacturer's web site and get their zero write utility. ... An error has been encounered that prevents setup from continuing. ...
    (microsoft.public.windowsxp.general)
  • Re: [RFC] sys_setrlimit() in 2.6.16
    ... caller's zero seconds into one second. ... sys_setrlimitneeds help first). ... It doesnt make much sense anyway to have ...
    (Linux-Kernel)
  • Re: Ibiquitys "Gag Order" on engineers
    ... would be more authoritative than the engineering dept. down the hall ... And how many years of radio broadcast experience? ... I see about zero ... Yeah, yeah, yeah... ...
    (rec.radio.shortwave)