为了在C文件中使用C++代码,我读到了我们可以做的extern "C" { (where the c++ code goes here)},但是当我尝试使用cout打印出来时,我不断收到错误,因为它无法识别库.我想我对extern"C"如何允许你在C中使用C++代码感到困惑.
extern "C" { (where the c++ code goes here)}
c++ extern-c
c++ ×1
extern-c ×1