From 6878247982372738381
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,6ff45f0dade42d18,start
X-Google-Attributes: gidf78e5,public
From: Bill Dimm <billd@gim.net>
Subject: strings and x[i] = '\0'
Date: 1996/07/30
Message-ID: <31FD7ACE.2941@gim.net>#1/1
X-Deja-AN: 171145072
x-original-date: Mon, 29 Jul 1996 23:00:30 -0400
organization: -
x-auth: PGPMoose V1.1 PGP comp.std.c++
newsgroups: comp.std.c++
originator: austern@isolde.mti.sgi.com
x-mailer: Mozilla 2.02 (Win95; I)


Looking at the April 95 ANSI draft I don't see any
language that prohibits the user from doing this (and
expecting it to work):

 string x("one");
 x[1] = '\0';
 cout << x.length() << endl;

Is the string object required to get the length right under
such circumstances?  This would seem to make it impractical to 
store the length of the string in the object.  Can anyone
provide clarification?

Thanks,
  Bill Dimm   billd@gim.net
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu 
]



