From mboxrd@z Thu Jan 1 00:00:00 1970 From: steffen@sdaoden.eu (Steffen Nurpmeso) Date: Thu, 09 Feb 2017 17:51:31 +0100 Subject: [TUHS] // comment in C++ In-Reply-To: <20170209144415.65AB418C11C@mercury.lcs.mit.edu> References: <20170209144415.65AB418C11C@mercury.lcs.mit.edu> Message-ID: <20170209165131.r156l%steffen@sdaoden.eu> jnc at mercury.lcs.mit.edu (Noel Chiappa) wrote: |> From: Michael Kjorling |> That wouldn't have anything to do with how ^@ is a somewhat common |> representation of 000, would it? .. I've always kind of wondered where |> that notation came from. | |Well, CTRL-<*> is usually just the <*> character with the high bits \ |cleared. |So, to have a printing representation of NULL, you have two character \ |choices |- SPACE, and '@'. Printing "^ " is not so hot, so "^@" is better. | |Also, if you look at an ASCII table, usually people just take the @-_ \ |column, |and use that, since every character in that column has a printing |representation. The ' '-? column is missing the ' ', and `- is missing |the DEL. So if you just take a CTRL character and set the 0100 bit, \ |and print |it as "^", you get something readable. You xor it via toupper(X)^0x40, yes of course. My code is right, it is just the manual that is incomplete or even false: i will clarify it. It is just that i know that many people which use free software don't know what a xor operation is, at least without looking into Wikipedia. (And even though i use it frequently myself, that is often contaminated by politics, just yesterday i had a hard time with some paragraphs on the German Wikipedia page on intellectual properties.) |(Note that CTRL-' ' _is_ usually used when one needs to _input_ a NUL |character.) | | Noel --steffen