Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!brl-adm!rutgers!clyde!burl!codas!mtune!mtuxo!pegasus!phoenix!mzal From: mzal@phoenix.UUCP (Mike Zaleski) Newsgroups: comp.lang.c Subject: Define CTRL(X) Message-ID: <1379@phoenix.UUCP> Date: Thu, 13-Nov-86 22:13:39 EST Article-I.D.: phoenix.1379 Posted: Thu Nov 13 22:13:39 1986 Date-Received: Sun, 16-Nov-86 00:06:04 EST Distribution: na Organization: AT&T Information Systems, Lincroft Lines: 21 [...] If one wants to do CTRL(X) and have it appear as though the character '^X' was in the source text, this can be done without single quotes by: # include # define CTRL(ZZ) ( (int) (*"ZZ" & 037) ) main () { fprintf (stdout, "%d %d %d %d\n", CTRL(A), CTRL(B), CTRL(Z), CTRL(@)); exit (0); } This is not bulletproof, since CTRL(") will cause compilation errors and some characters (like DEL) won't work with this. But if you just wanted CTRL(A) .. CTRL(Z), this seems fairly straightforward. It worked on our System Vr2 C compiler. -- "The Model Citizen" Mike^Z [ allegra, ihnp4 ] phoenix!mzal Zaleski@Rutgers.Arpa