Why would you use 'extern “C++”'?

前端 未结 10 1448
失恋的感觉
失恋的感觉 2020-12-12 17:37

In this article the keyword extern can be followed by \"C\" or \"C++\". Why would you use \'extern \"C++\"\'? Is it practical?

10条回答
  •  心在旅途
    2020-12-12 18:37

    Short answer is that you can use extern C to tell the compiler not to use name-mangling. This means you can link together bits of C and C++ code in the same project.

提交回复
热议问题