You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
`#include
#include
using namespace std;
int main(int argc, char const *argv[])
{
string t(10, 'a');
string a("ABC");
cout << t << " capacity : " << t.capacity() <<" max_size :"<< t.max_size()<< endl;
cout << a << " capacity : " << a.capacity() <<" max_size :"<< a.max_size()<< endl;
return 0;
}`
the result is :
aaaaaaaaaa capacity : 15 max_size :9223372036854775807
ABC capacity : 15 max_size :9223372036854775807
Is the return value of the function capacity and max_size fixed ?
if not, decide by what ?
Beta Was this translation helpful? Give feedback.
All reactions