Difference between string.h and cstring?

前端 未结 7 1316
耶瑟儿~
耶瑟儿~ 2020-12-03 03:13

What is the difference between string.h and cstring?

Which one should be used for C and which one for C++ (if at all)?

7条回答
  •  心在旅途
    2020-12-03 03:50

    While using , some answers suggest using std:: namespace. However, the code will still compile and run without the std namespace. This is because: = "string.h" +

    This was done to maintain compatibility with C. Try it yourself by including and calling both memcpy() and std::memcpy().

提交回复
热议问题