Richard wrote:
> Barry Schwarz <> writes:
>
>> On Sat, 24 Nov 2007 15:56:07 +0000 (UTC),
>> (Kenny McCormack) wrote:
>>
>>> In article <a3f33b3f-bb91-4dff-b2ea->,
>>> lovecreatesbea...@gmail.com <> wrote:
>> snip
>>
>>>> This string "0" consists of two characters. The only string that
>>>> consists of a single char is "".
>>> strlen() and common sense say otherwise. You are confusing how big
>>> something is with how much space it takes to store it. They are rarely
>>> the same thing, and the later is usually greater than the former.
>> And you are refusing to accept the definition in the standard. From
>> para 7.1.1-1: "A string is a contiguous sequence of characters
>> terminated by and including the first null character."
>
> And you are refusing to understand what KM said. There is a difference
> between the length of a string and the space needed to store it. As is
> clear from this thread and has been true since the day C was invented.
And you are refusing to look at what Kenny said in context. Kenny
claimed that the statement
>>>> This string "0" consists of two characters. The only string that
>>>> consists of a single char is "".
was wrong. Kenny was incorrect, totally and absolutely, by definition.
Kenny introduced the ideas of "how big something is" and "how much space
it takes" which aren't relevant to the statement he was supposedly
correcting. A string consists of a sequence of characters up to and
including the first null character, and has done since the day C was
invented.
> Length is analogous to "how many character do you display in the real
> world" whereas "size" is "how much storage space do you need".
If that's how you choose to define them, that's fine. It's not relevant
to the question in hand though.