根据我的要求。假设我有以下文件
abc.h //used for C file
int new; // All C++ keywords, new use as a variable
char class; // All C++ keywords, class use as a variable
Actual_task();
abc.c //C file
main()
{
...//Body of file where they have used new and class variable
new++; //for an example
class = 'C';
actual_task();//One function is getting called here
}
我有一个.cpp文件需要abc.h使用included该文件actual_task():
CPPfile.cpp
extern "C"{
#include "abc.h"
}
然后它会像变量一样抛出errors并且class不能new像变量一样使用。
那么如何在文件中使用C头cpp文件呢?