Examveda

What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
int main ()
{
    string str ("Ubuntu");
    cout << str.capacity();
    cout << str.max_size();
    return 0;
}

A. 61073741820

B. 51073741820

C. 6 and max size depends on compiler

D. 15
9223372036854770000

Answer: Option D


Join The Discussion

Related Questions on Classes and Objects in C plus plus