In the <basic_string.h >, I find the implementation of these two
functions. But I can't understand the difference between them.
Please give me some help!
//basic_string::c _str()
const _CharT*
c_str() const
{
// MT: This assumes concurrent writes are OK.
size_type __n = this->size();
traits_type::as sign(_M_data()[__n], _Rep::_S_termin al);
return _M_data();
}
//basic_string::d ata()
const _CharT*
data() const { return _M_data(); }
Thanks!