comp.lang.c
[Top] [All Lists]

Re: printf and cout

Subject: Re: printf and cout
From: Kenneth Brody
Date: Wed, 26 Mar 2008 12:33:32 -0400
Newsgroups: comp.lang.c

Bernhard Schauer wrote:
> 
> Richard Heathfield wrote:
> 
[... Snipped context: printf's "%c" output of (char)144 equivalent ...]
> 
> > There aren't any unknown ASCII characters. If the printed '?' /is/ an
> > ASCII character, then it has code point 63. If it hasn't, then it isn't an
> > ASCII character.
> 
> Thats ok. But if there is a number as character printed (depending on the
> locale, thus not guaranteed to be ASCII) that is "unprintable" (control
> codes, ...) a special character may be inserted by the terminal - it looks
> like a question mark (it may also be one).
> 
> On my computer a white question mark on a black background is printed.

I get a capital E-acute when printing character 144.

  <!ENTITY Eacute CDATA "&#201;" -- latin capital letter E with acute,
                                    U+00C9 ISOlat1 -->

The point being: C doesn't guarantee ASCII, and ASCII doesn't guarantee
anything above 0x7f.

-- 
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody        | www.hvcomputer.com | #include              |
| kenbrody/at\spamcop.net | www.fptech.com     |    <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:ThisIsASpamTrap@xxxxxxxxx>



<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy