Velocity Reviews > about string and character

ymuntyan@gmail.com
Guest
Posts: n/a

 11-28-2007
On Nov 24, 3:27 am, "(E-Mail Removed)" <(E-Mail Removed)> wrote:
> what is the difference between a single character and a string
> consisting only one character

39 posts so far (as displayed here), and no answer. Philosophy is fun!

Yevgen

santosh
Guest
Posts: n/a

 11-28-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> On Nov 24, 3:27 am, "(E-Mail Removed)" <(E-Mail Removed)> wrote:
>> what is the difference between a single character and a string
>> consisting only one character

>
> 39 posts so far (as displayed here), and no answer. Philosophy is fun!

Huh? There *have* been answers, just not ones handed out on a plate.

ymuntyan@gmail.com
Guest
Posts: n/a

 11-28-2007
On Nov 28, 9:07 am, santosh <(E-Mail Removed)> wrote:
> (E-Mail Removed) wrote:
> > On Nov 24, 3:27 am, "(E-Mail Removed)" <(E-Mail Removed)> wrote:
> >> what is the difference between a single character and a string
> >> consisting only one character

>
> > 39 posts so far (as displayed here), and no answer. Philosophy is fun!

>
> Huh? There *have* been answers, just not ones handed out on a plate.

Well, for instance yours wasn't an answer to the original question.
But I
could have missed one, I guess.

char a = 0;

The byte occupied by this object constitutes a one-character string,
you know.
Looking forward for amusing explanations of how a sequence of one
element is
different from one element

Best regards,
Yevgen

Chris Dollin
Guest
Posts: n/a

 11-28-2007
(E-Mail Removed) wrote:

> On Nov 24, 3:27 am, "(E-Mail Removed)" <(E-Mail Removed)> wrote:
>> what is the difference between a single character and a string
>> consisting only one character

>
> 39 posts so far (as displayed here), and no answer.

--
Chris "isopropyl" Dollin

Hewlett-Packard Limited registered office: Cain Road, Bracknell,
registered no: 690597 England Berks RG12 1HN

santosh
Guest
Posts: n/a

 11-28-2007
(E-Mail Removed) wrote:

> On Nov 28, 9:07 am, santosh <(E-Mail Removed)> wrote:
>> (E-Mail Removed) wrote:
>> > On Nov 24, 3:27 am, "(E-Mail Removed)" <(E-Mail Removed)> wrote:
>> >> what is the difference between a single character and a string
>> >> consisting only one character

>>
>> > 39 posts so far (as displayed here), and no answer. Philosophy is
>> > fun!

>>
>> Huh? There *have* been answers, just not ones handed out on a plate.

>
> Well, for instance yours wasn't an answer to the original question.
> But I could have missed one, I guess.

At a glance you seem to have missed at least four perfectly good
answers. I agree that mine wasn't one of them.

As for the sub-thread following the post by "lovecreatesbeauty", the OP
can easily ignore that if he is not interested in legalistic minutiae.

<snip>

Chris Dollin
Guest
Posts: n/a

 11-28-2007
(E-Mail Removed) wrote:

> On Nov 28, 9:07 am, santosh <(E-Mail Removed)> wrote:
>> (E-Mail Removed) wrote:
>> > On Nov 24, 3:27 am, "(E-Mail Removed)" <(E-Mail Removed)> wrote:
>> >> what is the difference between a single character and a string
>> >> consisting only one character

>>
>> > 39 posts so far (as displayed here), and no answer. Philosophy is fun!

>>
>> Huh? There *have* been answers, just not ones handed out on a plate.

>
> Well, for instance yours wasn't an answer to the original question.
> But I
> could have missed one, I guess.
>
> char a = 0;
>
> The byte occupied by this object constitutes a one-character string,
> you know.

It does not. (Not in C, it doesn't.)

> Looking forward for amusing explanations of how a sequence of one
> element is different from one element

Shame, really; at the moment (and earlier) I can only do unamusing
true ones.

--

Hewlett-Packard Limited registered office: Cain Road, Bracknell,
registered no: 690597 England Berks RG12 1HN

ymuntyan@gmail.com
Guest
Posts: n/a

 11-28-2007
On Nov 28, 9:19 am, Chris Dollin <(E-Mail Removed)> wrote:
> (E-Mail Removed) wrote:
> > On Nov 24, 3:27 am, "(E-Mail Removed)" <(E-Mail Removed)> wrote:
> >> what is the difference between a single character and a string
> >> consisting only one character

>
> > 39 posts so far (as displayed here), and no answer.

>

I actually did.

This I can't do unfortunately. Could you quote the answer?

Yevgen "comp.lang.c is fun as usual" Muntyan

ymuntyan@gmail.com
Guest
Posts: n/a

 11-28-2007
On Nov 28, 9:21 am, Chris Dollin <(E-Mail Removed)> wrote:
> (E-Mail Removed) wrote:
> > On Nov 28, 9:07 am, santosh <(E-Mail Removed)> wrote:
> >> (E-Mail Removed) wrote:
> >> > On Nov 24, 3:27 am, "(E-Mail Removed)" <(E-Mail Removed)> wrote:
> >> >> what is the difference between a single character and a string
> >> >> consisting only one character

>
> >> > 39 posts so far (as displayed here), and no answer. Philosophy is fun!

>
> >> Huh? There *have* been answers, just not ones handed out on a plate.

>
> > Well, for instance yours wasn't an answer to the original question.
> > But I
> > could have missed one, I guess.

>
> > char a = 0;

>
> > The byte occupied by this object constitutes a one-character string,
> > you know.

>
> It does not. (Not in C, it doesn't.)

Yes it does. It constitutes a (one-element) contiguous sequence
of characters terminated by and including the first null character.

Regards,
Yevgen

Richard
Guest
Posts: n/a

 11-28-2007
santosh <(E-Mail Removed)> writes:

> (E-Mail Removed) wrote:
>
>> On Nov 24, 3:27 am, "(E-Mail Removed)" <(E-Mail Removed)> wrote:
>>> what is the difference between a single character and a string
>>> consisting only one character

>>
>> 39 posts so far (as displayed here), and no answer. Philosophy is fun!

>
> Huh? There *have* been answers, just not ones handed out on a plate.

How do you answer questions then? In code?

Philip Potter
Guest
Posts: n/a

 11-28-2007
(E-Mail Removed) wrote:
> On Nov 28, 9:21 am, Chris Dollin <(E-Mail Removed)> wrote:
>> (E-Mail Removed) wrote:
>>> On Nov 28, 9:07 am, santosh <(E-Mail Removed)> wrote:
>>>> (E-Mail Removed) wrote:
>>>>> On Nov 24, 3:27 am, "(E-Mail Removed)" <(E-Mail Removed)> wrote:
>>>>>> what is the difference between a single character and a string
>>>>>> consisting only one character
>>>>> 39 posts so far (as displayed here), and no answer. Philosophy is fun!
>>>> Huh? There *have* been answers, just not ones handed out on a plate.
>>> Well, for instance yours wasn't an answer to the original question.
>>> But I
>>> could have missed one, I guess.
>>> char a = 0;
>>> The byte occupied by this object constitutes a one-character string,
>>> you know.

>> It does not. (Not in C, it doesn't.)

>
> Yes it does. It constitutes a (one-element) contiguous sequence
> of characters terminated by and including the first null character.

A sequence of characters has type char[]. Your variable 'a' has type
char. Therefore, a is not a sequence of one character. If you had

char a[1] = {0};

then your statement would have been correct.

Other properties of a sequence which your variable 'a' lacks:

* Sequences can be subscripted: a[i]
* Sequences decay to a pointer when, among other things, used as a
function parameter - f(a) should pass a 'char *' to f()