Link to home
Start Free TrialLog in
Avatar of Particleness
Particleness

asked on

Logic problem

      int k;
      int m;
      TRACE("%d ",!(iNewPlace>=(sLine.length()-1)));      //outputs 1

      TRACE("%d ",iNewPlace);      //outputs 0
      TRACE("%d ",sLine.length()-1);      //outputs -1

      TRACE("%d ",((iNewPlace>=(sLine.length()-1))));      //outputs 0

      TRACE("%d ",((m=iNewPlace)>=(k=(sLine.length()-1))));      //outputs 1

      TRACE("%d ",0>=-1);      //outputs 1

      k=iNewPlace;
      m=sLine.length()-1;
      TRACE("%d ",k>=m);      //outputs 1

Why is TRACE("%d ",((iNewPlace>=(sLine.length()-1))));      outputting false?
ASKER CERTIFIED SOLUTION
Avatar of bcladd
bcladd

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Particleness
Particleness

ASKER

sLine.lenth() was unsigned, but iNewPlace was signed. Nevertheless you  helped me out.