Re: I cant do change string to int.



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.

--
Ben.
.



Relevant Pages

  • Re: I cant do change string to int.
    ... emre 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. ... code changes it, so the if part of the if/else statement is always ...
    (comp.lang.c)
  • Re: Interesting math
    ... And I wouldn't be too sure about "it" knowing that "zero is ... and odd numbers. ... The same sort of issue arises across all sorts of mathematics. ... my computer science and maths students is persuading them that the difference ...
    (alt.usage.english)
  • 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: Division by zero
    ... I have a theory to work with division by zero, ... use in computer science. ... mainly so that polynomial and power series manipulations give the ... --- Christopher Heckman ...
    (comp.theory)