Re: Sizeof vs. Strlen

From: CBFalconer (cbfalconer_at_yahoo.com)
Date: 05/28/04


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


Relevant Pages

  • Re: Recognize A User From A Win 2k Domain?
    ... what you suggest should work just fine on the mapping side. ... put this batch file in my startup folder on the 2K machine. ... >> * PLEASE post all messages and replies in the newsgroups ... >>>>> When I go to Windows Explorer, Tools, Map Network Drive on my laptop ...
    (microsoft.public.windowsxp.network_web)
  • [OT] Linux distro recommendations for HP Omnibook 900B laptop? [was Re: Comparioson of purpose for P
    ... RH9 is the only relatively new distro I have CDs for. ... I currently have only a CardBus Xircom combo modem and ethernet card ... (Email replies are welcome, if you wish. ... *rebuilding* Windows machines. ...
    (comp.lang.python)
  • Re: Need Explanation of Web Client in Services
    ... This is a normal service in Windows XP. ... PLEASE post all messages and replies in the newsgroups ... "Chad Harris" wrote in message ... and a pulldown with a hardware profile entry. ...
    (microsoft.public.windowsxp.network_web)
  • Re: problem with access rights
    ... Private mail is usually not replied to. ... >> The problem here is that Windows 98 file sharing is by default insecure, ... uses a more secure file sharing method. ... >> * PLEASE post all messages and replies in the newsgroups ...
    (microsoft.public.win2000.networking)
  • Re: ADOX/ADO quirk when creating a primary key
    ... But if I comment out the line to add the primary key, ... The original problem was encountered on a Windows 2000 PC running Office ... Windows XP and Excel 2003. ...
    (microsoft.public.data.ado)