CTRL(x) macro (was: Re: What is a constant expression)

Wm E Davidsen Jr davidsen at crdos1.crd.ge.COM
Wed Oct 25 03:02:45 AEST 1989


In article <3786 at solo6.cs.vu.nl>, maart at cs.vu.nl (Maarten Litmaath) writes:
|  
|  	#define CTRL(x) ((x) ^ 0100)
|  
|  ...so you can say
|  
|  	CTRL('?')
|  
|  to get DEL.

  You should use another name, perhaps, since many people assume that
CTRL returns control characters. They are defined as the values from
00-37 octal, from the action of the Control key on the original Teletype
terminals. 
-- 
bill davidsen	(davidsen at crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen)
"The world is filled with fools. They blindly follow their so-called
'reason' in the face of the church and common sense. Any fool can see
that the world is flat!" - anon



More information about the Comp.lang.c mailing list