home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!elroy.jpl.nasa.gov!nntp-server.caltech.edu!nntp-server!brannon
- From: brannon@stun4r.cs.caltech.edu (Terrence M. Brannon)
- Subject: why does #define Ctrl(c) c&037 work ?
- Message-ID: <BRANNON.92Aug12164222@stun4r.cs.caltech.edu>
- Sender: news@cco.caltech.edu
- Nntp-Posting-Host: stun4r.cs.caltech.edu
- Organization: Caltech Yoga Qi Gong Tai Chi
- References: <1992Aug12.133132.10723@Princeton.EDU>
- Distribution: worrrld
- Date: Thu, 13 Aug 1992 00:42:22 GMT
- Lines: 17
-
-
- I am hacking thru the source code for GNU Emacs and I came across
- this:
-
- #define Ctl(c) ((c)&037)
-
- and I am wondering why a bitwise-AND of the ASCII value for a chacter
- and octal 037 (binary 00111111) would generate the control version of
- a printable character.
-
- --
-
- Terrence Brannon (brannon@jove.cs.caltech.edu)
- medical biology via acupuncture and particle physics
-
-
-
-