From -8625837945269237080 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f78e5,25a6c79e64b4e6be X-Google-Attributes: gidf78e5,public X-Google-ArrivalTime: 2000-10-11 21:11:05 PST Path: supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!news.tele.dk!212.74.64.35!colt.net!dispose.news.demon.net!demon!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail From: Ron Natalie Newsgroups: comp.std.c++ Subject: Re: NUL character in basic_string Date: Thu, 12 Oct 2000 04:10:05 GMT Organization: Sensor Systems Approved: Fergus Henderson , moderator of comp.std.c++ Message-ID: <39E50EE9.DF617BB1@sensor.com> References: <39E4D6F8.653BA13F@vger.vsin.com> X-Trace: mail2news.demon.co.uk 971323815 mail2news:12440 mail2news mail2news.demon.co.uk X-Complaints-To: abuse@demon.net X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov) Mime-Version: 1.0 Content-Type: text/plain; charset=x-user-defined Content-Transfer-Encoding: 7bit X-Accept-Language: en Lines: 34 Xref: supernews.google.com comp.std.c++:1413 Curtis Smith wrote: > > My reading of the C++ standard leads me to believe that the basic_string > template (string, wstring, &c.) may contain NUL characters (that is, 0 > widened to the appropriate type), but some library implementors don't seem > to support such strings. Is that one of those thing that is ludicrous for > me to expect, given the traditional handling of strings in C, or what? > VC++, the Spar Compiler, and G++ all seem to support it fine: #include #include using namespace std; int main() { char* s = "abcd\0efth"; string str(s, 9); cout << str <