For a C++ string s, is s[s.size()] legal and always equal to '\0'?
If s[s.size()]=='\0', then it is convenient to treat it as a sentinel for some algorithm. I did a test and it's always equal to '\0', but some books says it's illegal to access s[s.size()].
Aucun commentaire:
Enregistrer un commentaire