String class doubt

whats is the purpose of adding a string header file?
Is this necessary to include it for declaring strings.
What is copy constructor? how is string copied by copy constructor?

String header files allows us to use string class, and functions defined on strings. We cannot use string datatype without string.h header file (although we can use character array for task related to string but that would also add responsibility of creating functions to perform operations on char array, that are easily available in string lib).
Copy constructors is used when copying objects of a class, it is created by the compiler even if it is not defined by user.
When we copy two strings, string s=s2; copy constructor will be called(as we are copying one object to another at the time of creation)

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.