[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Shouldn't "char*" be "unsigned char*"?
- From: Rob Kendrick <rjek@...>
- Date: Tue, 24 May 2011 09:59:37 +0100
On Tue, May 24, 2011 at 10:43:13AM +0200, Dirk Laurie wrote:
> Sorry for betraying my newbie-ness, this question was probably asked
> fifteen years ago.
> In the Lua API, Lua strings are mapped to C "char*". Is this just a
> historical accident or a closely reasoned decision, such as that the
> convenience of the test "if (c<0)" to detect non-ASCII is more
> important than the inconvenience of occasional casts from "char*" to
> "unsigned char*"?
Lua's written in C, and C strings are char *, not unsigned char * :)
Also, on some platforms, 'char' is unsigned.