tags:

views:

85

answers:

4

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..

A: 

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

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

MBZ
According to what?
Dominic Rodger
Fixed his HTML.
Matt Ball
A: 

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
A: 

by the way this is a duplicate of this question

MBZ
This should be a comment.
Jefromi
+8  A: 
std::string s;
s.max_size();

That should tell you what that max size is.

David Burhans
+1 -- beat me to it by 2 seconds! :-)
Jerry Coffin