如题所示,c++中头文件<string.h> <string>有什么区别麽?还有<math> <math.h>
编译器都能过,请指教。
迷茫2017-04-17 15:18:11
<string.h> C version header file.
<string> The header file defined by the C++ standard, which defines a string class of string, which contains various operations of the string class. Moreover, <string> also includes the old C version of string operations such as strcpy, strcat, etc. This is equivalent to adding an #include< in addition to defining its own string class in the <string> file. ;string.h> contains the C version of string operations.
The relationship between <math> and <math.h> is the same as above.
PHP中文网2017-04-17 15:18:11
The corresponding C++ header file of
<string.h> is <cstring>
<math.h> The corresponding C++ header file is <cmath>
<string> is C++ std:: string
<math>I don’t know what it is either
迷茫2017-04-17 15:18:11
+1 upstairs.
Moreover, in C++11, if you add .h, there should be a warning or an error, right?