0

Possible Duplicate:
Maximum length of a std::basic_string<_CharT> string

I would like to know how many characters does string class in c++ support.

thanks..

Community
  • 1
  • 1
smeerkahoven
  • 173
  • 3
  • 9

3 Answers3

8
std::string s;
s.max_size();

That should tell you what that max size is.

David Burhans
  • 363
  • 1
  • 9
0

according to http://www.idinews.com/string3.html

The std::string class supports varying length strings with no length limit.

MBZ
  • 26,084
  • 47
  • 114
  • 191
0

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.

David Ipsen
  • 1,513
  • 1
  • 15
  • 22