Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Nobody <nobody@nowhere.com> |
|---|---|
| Subject | Re: Is char obsolete? |
| Date | 2011-04-08 20:10 +0100 |
| Message-Id | <pan.2011.04.08.19.10.09.641000@nowhere.com> |
| Newsgroups | comp.lang.c |
| References | <inn180$1e3$1@oravannahka.helsinki.fi> <innf6e$5v5$1@oravannahka.helsinki.fi> |
| Organization | Zen Internet |
On Fri, 08 Apr 2011 17:04:14 +0000, Lauri Alanko wrote: > Firstly, I'm talking specifically about the type "char". The > types "signed char" and "unsigned char" are perfectly > useful (though idiosyncratically named) integer types for > operating on the smallest addressable memory > units (a.k.a. bytes). > > The type "char" is distinct from these, and it is strictly less > useful as an integer (due to its implementation-specific > signedness). So the only justification for it that I can see is > that it serves as a semantic annotation: a char is a byte that is > intended to be interpreted as a character in the basic execution > character set. It has another justification: efficiency. Most of the time, you don't actually care whether char is signed or unsigned, or even integral for that matter. > The standard library uses the type "char *" for its > representation of strings: > In any case, we are not forced to use the standard library as > such. You are if you want to interface to the OS. Aside from the ANSI/ISO C functions, the Unix API uses char* extensively (Windows, OTOH, uses wide characters).
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Is char obsolete? Lauri Alanko <la@iki.fi> - 2011-04-08 13:06 +0000
Re: Is char obsolete? Chris H <chris@phaedsys.org> - 2011-04-08 14:55 +0100
Re: Is char obsolete? Thomas Richter <thor@math.tu-berlin.de> - 2011-04-08 17:04 +0200
Re: Is char obsolete? Chris H <chris@phaedsys.org> - 2011-04-08 16:32 +0100
Re: Is char obsolete? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-04-08 17:02 +0100
Re: Is char obsolete? Thomas Richter <thor@math.tu-berlin.de> - 2011-04-09 21:57 +0200
Re: Is char obsolete? James Kuyper <jameskuyper@verizon.net> - 2011-04-09 16:47 -0400
Re: Is char obsolete? William Ahern <william@wilbur.25thandClement.com> - 2011-04-09 15:10 -0700
Re: Is char obsolete? James Kuyper <jameskuyper@verizon.net> - 2011-04-09 18:44 -0400
Re: Is char obsolete? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-04-08 16:13 +0100
Re: Is char obsolete? Keith Thompson <kst-u@mib.org> - 2011-04-08 12:55 -0700
Re: Is char obsolete? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-04-08 22:16 +0100
Re: Is char obsolete? Lauri Alanko <la@iki.fi> - 2011-04-08 17:04 +0000
Re: Is char obsolete? Nobody <nobody@nowhere.com> - 2011-04-08 20:10 +0100
Re: Is char obsolete? "robertwessel2@yahoo.com" <robertwessel2@yahoo.com> - 2011-04-08 15:43 -0700
Re: Is char obsolete? Nobody <nobody@nowhere.com> - 2011-04-09 22:44 +0100
Re: Is char obsolete? "BartC" <bc@freeuk.com> - 2011-04-08 21:04 +0100
Re: Is char obsolete? William Ahern <william@wilbur.25thandClement.com> - 2011-04-08 15:01 -0700
Re: Is char obsolete? Lauri Alanko <la@iki.fi> - 2011-04-09 14:27 +0000
Re: Is char obsolete? "BartC" <bc@freeuk.com> - 2011-04-09 19:14 +0100
Re: Is char obsolete? William Ahern <william@wilbur.25thandClement.com> - 2011-04-09 12:02 -0700
Re: Is char obsolete? Ian Collins <ian-news@hotmail.com> - 2011-04-09 09:40 +1200
Re: Is char obsolete? Florian Weimer <fw@deneb.enyo.de> - 2011-04-08 23:07 +0200
csiph-web