根據我的要求。 假設我有以下文件如何在.cpp文件中使用C++關鍵字?
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
不能隨便用像一個變量。
那麼如何在cpp
文件中使用C
頭文件?
無賴...你不能。 –
這個要求來自哪裏? –
@BjörnPollex:這是一個單獨的任務,它正在調用feom ac文件,但現在我必須控制它,並且需要從cpp文件調用它 –