Difference between string and cstring

difference between string and cstring

string is a object of c++ while cstring helps u to use char string features in c++

Hey Gaurav,
As you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.

you mean If I use char[100] than i will used cstring.h
and if I am using STL than I should use string.h

no u can define char[100] normally but when u have to use the inbuild function like copy strcpy concatenate strcnt then u have to use cstring ,it has a meaning cstring means string of c language in c language char array is consider as string but in c++ string is seperately a different object u can use char a[100] and string s for same purpose but there are some difference between them like string is terminated by null and if u have to use inbuilt string functuion like string.size(),string.erase etc then u have to use string library
Hope this help:)

1 Like

thank you…