This C++ code defines a string str and initializes it with the value "TutorJoe's is a Coaching centre". It then prints out the initial value of the string and its capacity using cout.
Here's a step-by-step breakdown of what happens in the code:
When the code is run, it should print out the initial string value and the capacity of the string to the console. The capacity of the string will depend on the implementation and the size of the string.
#include<iostream> #include<string.h> using namespace std; int main() { string str = "TutorJoe's is a Coaching centre"; cout<<"\nThe Initial string is : "; cout<<str<<endl; cout<<"\nThe capacity of string is : "; cout<<str.capacity()<<endl; return 0; }To download raw file Click Here
The Initial string is : TutorJoe's is a Coaching centre The capacity of string is : 31
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions