Czy „& s [0]” wskazuje na ciągłe znaki w łańcuchu std ::?
Wykonuję prace konserwacyjne i natrafiłem na coś takiego:
std::string s;
s.resize( strLength );
// strLength is a size_t with the length of a C string in it.
memcpy( &s[0], str, strLength );
Wiem, że użycie & s [0] byłoby bezpieczne, gdyby był std :: vector, ale czy jest to bezpieczne użycie std :: string?