I have code where I output the max length of a std::string object:
string s;
cout<<s.max_size()<<endl;
cout << INT_MAX << endl;
cout<<LLONG_MAX<<endl;
Output :
4611686018427387897
2147483647
9223372036854775807
If it's not difficult, please explain why the maximum size of std::string is 4611686018427387897. This is approximately half of LLONG_MAX.