home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / c / 16377 < prev    next >
Encoding:
Text File  |  1992-11-11  |  933 b   |  31 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!portal!dfuller
  3. From: dfuller@portal.hq.videocart.com (Dave Fuller)
  4. Subject: last of TRUE & FALSE
  5. Message-ID: <BxL7oF.DJE@portal.hq.videocart.com>
  6. Organization: VideOcart Inc.
  7. X-Newsreader: Tin 1.1 PL3
  8. Date: Thu, 12 Nov 1992 05:09:51 GMT
  9. Lines: 20
  10.  
  11. This will be the end of my mail on TRUE & FALSE -> C_SUCCESS & C_FAILURE
  12.  
  13. I noted that i didn't use them for logical tests that c handled on its own.
  14. what i would use it for though is a routine that was getting a defined
  15. valid key constantly (say get_key() tested for presses of A,C,D,E or T)
  16. and i wanted to continue fetching until the user hit a key that didn't 
  17. fall into the group I would do.
  18.  
  19. while (get_key() == C_SUCCESS)
  20. {
  21.   total_key_presses ++;
  22. }
  23. printf("Hit A,C,D,E, or T %d times\n", total_key_presses);
  24.  
  25. in this manner all of my functions dont use a hardcoded value to test
  26. against.
  27.  
  28. Dave Fuller
  29. dfuller@portal.hq.videocart.com
  30.  
  31.