Using/Mixing C in C++ code?

前端 未结 12 1587
南旧
南旧 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:29

    Yes it's bad to mix C and C++, any the reason has nothing to do with performance or security:

    It is bad cause of a maintainability:
    * a C++ programmer expects all code to behave like C++.
    * a C programmer expects all code to behave like C.

    So when you mix C++ and C, you break both programmers expectations on how things should work.

提交回复
热议问题