To use memset(), what is the difference between
#include <string> //did not work
and
#include <string.h> //worked
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
<string>is a C++ standard library include, and<string.h>is C standard library include.The equivalent of
<string.h>in C++ is<cstring>, although both will work.The difference is:
<cstring>wraps everything in thestdnamespace whereas<string.h>puts everything in the global namespace.Also, expect some stricter type safety rules from
<cstring>.