Tuesday, June 8, 2010

const string

Given: const std::string mine("mine"); (mine[mine.length()] == '\0') is true, because for constant strings, the '\0' is guaranteed to be there.

Reference: The C++ Standard Library: A Tutorial and Reference by Nicolai M. Josuttis, Addison-Wesley, 1999, p. 487.

No comments:

Post a Comment