开发者

How many characters does string class in c++ support? [duplicate]

开发者 https://www.devze.com 2023-01-08 23:19 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicate: Maximum length of a std::basic_string<_CharT> string
This question already has answers here: Closed 12 years ago.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消