question. <string> or <string.h>

is there a difference between the two?
Drop the .h as many compilers will warn that .h is deprecated
Yes,

<string> contains the C++ std::string class.
<string.h> or <cstring> contains C-string utilities such as strcmp and memcpy.

http://cplusplus.com/reference/string/
http://cplusplus.com/reference/cstring/
The second is the standard C header that contains some functions declarations for character arrays. In C++ this header is specified as <cstring>.
The first header is a C++ header containing the definition of template class std::basic_string.
Both are header files. Files that you have access to. It is possible, although daunting, to look at them. One peek would already answer the "is there a difference". Since answer is "yes", the above posts have explained "how they differ".
Topic archived. No new replies allowed.