What’s the difference between
#include<string> & #include<cstring>
?
Both are same?
if not then, in which cases I should use each of these header files?
Difference in header files
Well, <cstring>
is basically a header containing a set of functions for dealing with C-style strings (char*). <string>
, on the other hand, is header that allows you to use C++style strings (std::string), which can do a lot of if not all of the functions provided in <cstring>
on their own.