What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
int main ()
{
string str = "HelloWorld!";
cout<<str.capacity();
cout<<str.size();
return 0;
}
#include <iostream>
#include <string>
using namespace std;
int main ()
{
string str = "HelloWorld!";
cout<<str.capacity();
cout<<str.size();
return 0;
}A. 1511
B. 1111
C. 1115
D. 010
Answer: Option A

Join The Discussion