Take the 2-minute tour ×  How come this code   compiles with
(I'm using MSVC 2010)  #include <string>  but not with  #include
<string.h>   share|improve this question  8 Answers 8  up vote
21 down vote accepted   • string.h contains old functions like
strcpy, strlen.   • string primarily contains the std::string
class. share|improve this answer It should also be noted that
using string.h is deprecated within C++. If you need the
functionality contained within, you should use the header
cstring. This more or less completely bypasses the issue of
"What's the difference between these two" because it's very
obvious that one is from the C library. –  Mike Bantegui Mar 11
'12 at 20:53  string.h is a C header not a C++ header, period!
share|improve this answer Do you mean that when I do a couple of
files .h/.cpp I should remove the .h or is your answer just for
euh, like sdk files? –  Valmond Feb 13 '12 at 9:05 I think, it's
better to say the other way: <string> is C++ header, not a C
header. –  iammilind Feb 13 '1