C And C++ Coding Standards

后端 未结 6 1994
不思量自难忘°
不思量自难忘° 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:49

    If you compile all your source with g++ then it is all compiled in C++ object files (i.e. with the appropriate name mangling and the C++ ABI).

    You will only need to use the extern "C" trick if you are building libraries that need to be used by explicitly C applications that need to use the C ABI.

    If everything is being compiled into a single executable then use g++ and treat everything as C++

提交回复
热议问题