How many characters does string class in c++ support? [duplicate]
Possible Duplicate:
Maximum length of a std::basic_string<_CharT> string
I wou开发者_如何学Cld like to know how many characters does string class in c++ support.
thanks..
std::string s;
s.max_size();
That should tell you what that max size is.
according to http://www.idinews.com/string3.html
The std::string class supports varying length strings with no length limit.
I am lead to believe that the size of a std::string object is limited to size of an unsigned integer on the architecture of your system. I would assume this since the length of the string is stored as a size_t value.
精彩评论