'1' + 1 ==> True ???

Jeff Epler jepler at unpythonic.net
Thu Mar 18 15:02:57 EST 2004


On Thu, Mar 18, 2004 at 08:46:04PM +0100, Peter Maas wrote:
> The mapping of '1' to 0x31 is defined by ASCII which is used by C. If a C
> instruction retrieves a char it reads data from an adress and if there is
> a 0x31 stored at the adress C treats it as '1'. My short form of this is
> "'1' is 0x31 in memory".

Wrong. (surely C99 didn't change this)

C doesn't require ASCII as a source-encoding nor as the character
encoding on the target machine.

C's requirements for character set are pretty minimal.  The letters and
digits are all required (can someone tell me whether lower-case is
required?), as well as a small set of punctuation, newline, and space.
(Are any of tab, carriage return, vertical tab, or formfeed required?)

This may be the required set of punctuation (the rest are available as
digraphs or trigraphs:
    ! " % & ' ( ) * + , - . / : ; < = > ? _

My source for the set of punctuation is:
    http://csit1cwe.fsu.edu/extra_link/vac/compiler/ref/rulngchr.htm

Jeff




More information about the Python-list mailing list