Topic: stringlibrary: data() versus c_str() a
Author: saroj@nynexst.com (Saroj Mahapatra)
Date: 1996/05/06 Raw View
In article 96May2122010@gabi.gabi-soft.fr, kanze@gabi-soft.fr (J. Kanze) writes:
> In article <jc.830939057@atcmpg> jc@atcmp.nl (Jan Christiaan van Winkel)
> writes:
>
> what should s.data() return compared to s.c_ptr() ?
>
> s.data should return a pointer to two bytes, containing 'h', 'i'.
> s.c_ptr should return a poitner to three bytes, containing 'h', 'i',
> '\0'.
>
The draft standard says string::data() should return c_str() if size() is nonzero,
otherwise a null pointer. Has it changed?
- Saroj Mahapatra, X/Motif/C++ consultant
[ comp.std.c++ is moderated. To submit articles: try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
[ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu ]