![]() |
|
|
|||||||
![]() |
C Programming - whats the use of unsigned char |
|
|
Thread Tools | Search this Thread |
|
|
#11 |
|
Seebs <usenet-> writes:
> On 2009-11-06, arnuld <> wrote: [...] >> char a = 'A'; [...] >> and hence /char a/ will actually be stored as number 65, not as 'A'. > > Right. Only half right. Assuming an ASCII-based system (that includes any of the numerous character sets derived from ASCII), the value stored in a can be written either as 65 or as 'A'. Both expressions have the same value and type (yes, character constants in C are of type int, for historical reasons). The value stored in a is a number, more specifically an integer. That value is written as 65. It can also be written as 'A'. The value stored in any char object is a small integer. Such a value is often *used* to represent a character value, but it needn't be. -- Keith Thompson (The_Other_Keith) kst- <http://www.ghoti.net/~kst> Nokia "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister" Keith Thompson |
|
|
|
|
#12 |
|
Posts: n/a
|
On 2009-11-06, Keith Thompson <kst-> wrote:
> Only half right. Yeah. I was trying to agree that so far as C is concerned, it's just a 65, it doesn't matter whether or not that happens to match a particular letter. The OP's confusion was apparently contagious, though. -s -- Copyright 2009, all wrongs reversed. Peter Seebach / usenet- http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated! Seebs |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| unsigned code | =?Utf-8?B?S2VudA==?= | Windows 64bit | 2 | 09-26-2007 03:24 PM |
| vista 64 - Unsigned drivers | BENAGLIA | Windows 64bit | 8 | 09-10-2007 05:44 PM |
| signed & unsigned drivers? | Kue2 | Windows 64bit | 2 | 09-01-2007 01:05 AM |
| How do You stop Vista from Blocking unsigned drivers | Kue2 | Windows 64bit | 16 | 01-30-2007 08:20 AM |
| Windows Vista Unsigned Drivers | mcbacon@gmail.com | Windows 64bit | 1 | 12-11-2006 11:50 PM |