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
string s;
s.resize(10);
No comments:
Post a Comment