home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19463 < prev    next >
Encoding:
Text File  |  1993-01-09  |  1.1 KB  |  36 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!portal!dfuller
  3. From: dfuller@portal.hq.videocart.com (Dave Fuller)
  4. Subject: Re: NH-- > NH
  5. Message-ID: <C0K4Fy.Fn7@portal.hq.videocart.com>
  6. Organization: VideOcart Inc.
  7. X-Newsreader: Tin 1.1 PL3
  8. References: <1993Jan8.210335.28340@sharebase.com>
  9. Date: Fri, 8 Jan 1993 22:43:10 GMT
  10. Lines: 24
  11.  
  12. keith@torme.sharebase.com (Keith Chambless) writes:
  13. : In article <C0JMw6.680@netnews.jhuapl.edu> bandy@netnews.jhuapl.edu (Mike Bandy) writes:
  14. : >
  15. : >So what you're saying is that NH > NH.  I don't believe it.  Your 
  16. : >compiler (or your logic) has some serious problems.
  17. : Weird. Mine (Solbourne w/OS/MP 4.0) works the same:
  18. :     if (nh-- > nh)
  19. :       printf("nh-- > nh = true\n");
  20. : prints true. I don't understand.
  21.  
  22.   If the left side is evaluated before the right side it will happen.
  23. nh-- has a value of nh because the -- takes place after expression evaluation.
  24. The -- will happen and then the right side of the expression will be evaluated.
  25. It will have a value of nh. However, nh at this point contains a value that is
  26. 1 less than the left hand side of the expression. 
  27.  
  28. Dave Fuller
  29. dfuller@portal.hq.videocart.com
  30.  
  31.