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

前端 未结 10 1428
失恋的感觉
失恋的感觉 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:44

    C and C++ use different name mangling rules. Essentially, extern "C" tells the C++ compiler to name the function as C would name it.

提交回复
热议问题