Doubt in string class

Hello, I want to know what is the difference between string class and cstring class ?

And why we use character arrays if we have this string class ? Is there a point in the way of learning when one can not solve a problem without character array ?

hello @yashsharma4304

string library is c++ library which has string class in it. and u can treat that class as a datatype just like int , float etc
whereas cstring library is there that allow us to import c type string in c++ code.
note : c string is an array whereas c++ string is a class.

we can use any of them both have all functionalities that is required to solve any string based problem

Ok :slightly_smiling_face:

But this is getting a liitle bit confusing as I am not aware of classes and objects.

ok no issue.
just treat string as a datatype like int ,float etc.

1 Like