home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / c / 12256 < prev    next >
Encoding:
Text File  |  1992-08-12  |  881 b   |  31 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!elroy.jpl.nasa.gov!nntp-server.caltech.edu!nntp-server!brannon
  3. From: brannon@stun4r.cs.caltech.edu (Terrence M. Brannon)
  4. Subject: why does #define Ctrl(c) c&037 work ?
  5. Message-ID: <BRANNON.92Aug12164222@stun4r.cs.caltech.edu>
  6. Sender: news@cco.caltech.edu
  7. Nntp-Posting-Host: stun4r.cs.caltech.edu
  8. Organization: Caltech Yoga Qi Gong Tai Chi
  9. References: <1992Aug12.133132.10723@Princeton.EDU>
  10. Distribution: worrrld
  11. Date: Thu, 13 Aug 1992 00:42:22 GMT
  12. Lines: 17
  13.  
  14.  
  15. I am hacking thru the source code for GNU Emacs and I came across
  16. this:
  17.  
  18. #define Ctl(c) ((c)&037)
  19.  
  20. and I am wondering why a bitwise-AND of the ASCII value for a chacter
  21. and octal 037 (binary 00111111) would generate the control version of
  22. a printable character.
  23.  
  24. --
  25.  
  26. Terrence Brannon       (brannon@jove.cs.caltech.edu)  
  27. medical biology via acupuncture and particle physics
  28.  
  29.  
  30.  
  31.