Wednesday, June 16, 2010

String Resize

Given:
    string s;
    s.resize(10);

s.length() is equal to 10.

New character positions will be filled in with the default value of char, which is the null character (0).

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

No comments:

Post a Comment