Re: Sizeof vs. Strlen
From: CBFalconer (cbfalconer_at_yahoo.com)
Date: 05/28/04
- Next message: CBFalconer: "Re: The Year 2038 Problem"
- Previous message: CBFalconer: "Re: Precedence and parenthesis (was: Possibilities of Return (with parameters???))"
- In reply to: Arthur J. O'Dwyer: "Re: Sizeof vs. Strlen"
- Next in thread: Default User: "Re: Sizeof vs. Strlen"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 28 May 2004 04:38:13 GMT
"Arthur J. O'Dwyer" wrote:
> On Thu, 27 May 2004, Christian Bau wrote:
>>
>> On most implementations, sizeof ("Hello, world!") - 1 != 13.
>> Usually the result will be 3 or 7.
>
> I count three replies so far along the lines of "gee, I think
> you're probably wrong." Just for the record: fourteen minus
> one is thirteen on every C implementation in existence. It is
> *never* 3, and it is *never* 7. Christian's statement was
> just plain wrong.
I think he is suffering from a temporary delusion that the parens
cause the string to be represented by a pointer. We all have
these problems when a cow flies by.
-- fix (vb.): 1. to paper over, obscure, hide from public view; 2. to work around, in a way that produces unintended consequences that are worse than the original problem. Usage: "Windows ME fixes many of the shortcomings of Windows 98 SE". - Hutchison
- Next message: CBFalconer: "Re: The Year 2038 Problem"
- Previous message: CBFalconer: "Re: Precedence and parenthesis (was: Possibilities of Return (with parameters???))"
- In reply to: Arthur J. O'Dwyer: "Re: Sizeof vs. Strlen"
- Next in thread: Default User: "Re: Sizeof vs. Strlen"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|