[TUHS] // comment in C++

Steffen Nurpmeso steffen at sdaoden.eu
Fri Feb 10 02:51:31 AEST 2017


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 `-<DEL> is missing
 |the DEL. So if you just take a CTRL character and set the 0100 bit, \
 |and print
 |it as "^<char>", 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


More information about the TUHS mailing list