samedi 25 février 2017

Why is s[0] is an empty string for an empty string s in C++?

The c++primer tell me s[s.size()] should be unpredictable.But I tried for many times,and insert it into other codes,s[0] is always an empty string.But when s is not an empty string, trying to access s[size()] will throw an error.Why is the empty string special?

Aucun commentaire:

Enregistrer un commentaire