Using/Mixing C in C++ code?

前端 未结 12 1560
南旧
南旧 2020-12-24 03:03

Is using C in C++ bad?

Many people have told me that using C in C++ is bad because it\'s not as safe, and it requires more memory management. I keep telling them tha

12条回答
  •  粉色の甜心
    2020-12-24 03:22

    regrading the argument over std::string vs char *.

    std::string is not going to be slower that char * (for heap char*); many implementations are much faster because they use private memory pool. And anyway the robustness of std::string far outweighs any (unlikely) perf hit

提交回复
热议问题