C And C++ Coding Standards

后端 未结 6 1988
不思量自难忘°
不思量自难忘° 2021-01-18 00:00

What are best practices with regards to C and C++ coding standards? Should developers be allowed to willy-nilly mix them together. Are there any complications when linking

6条回答
  •  鱼传尺愫
    2021-01-18 00:53

    C++ doesn't do 'typesafe checks' at run time unless you ask for them (by using dynamic_cast). C++ is highly compatible with C, so you may freely call C libraries as you wish and compile C code with a C++ compiler. C++ does not imply 'object-oriented', and you should get no performance penalty from using it.

    If you mix code compiled with gcc and with g++, see Graeme's answer.

提交回复
热议问题