Is there a difference between <string> and <cstring>?
Printable View
Is there a difference between <string> and <cstring>?
<string> contains the string class, <cstring> contains the char* manipulation functions(strlen, etc...).
Code:#include <string>
using namespace std;
int main()
{
string test = "a string";
return(0);
}
Code:#include <cstring>
using namespace std;
int main()
{
char* test = "a string";
int l = strlen(test); //gets the length of character pointer test.
return(0);
}