Answers:
Any string is made up of characters.
Consider a statement in C:
char name[size];
In the above statement, you declare a character array 'name' of a certain size 'size', which can be used to store a set of characters.
In c++, we do the same thing but in a slightly different way. C++ has a ready made construct for storing strings using a 'string' class.
We do not need to declare the size as it is declared by the class itself.
So, we can just use the following:
string strname;
Hope this answers your question
Thanks
Spoken Tutorial Team
Login to add comment