<string> & <cstring>

What’s the difference between #include & #include? & when to include which one?

hello @gambhirrahul0
The cstring header provides functions for dealing with C-style strings — null-terminated arrays of characters. This includes functions like strlen and strcpy . It’s the C++ version of the classic string.h header from C.

The string header provides the std::string class and related functions and operators.

The headers have similar names, but they’re not really related beyond that. They cover separate tasks.

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.