我有一个供应商指定的ADC和其他外设代码。
现在我用它来理解流程。
文件的扩展是.CPP,但是语句类似C,而不是C++。
即使用printf()而不是cout;
未定义namespace.std。。。还有其他一些东西使我确信它是一个c语言代码。
(恕我直言,无论我向供应商提出什么要求,但从那以后答复就很晚了)
所以这是一个完整的C代码。但当我理解的时候,我到了一个定义类的地步,我现在真的很困惑。因为我没见过也没听说有人在上课
C4DSPBlast cBlast;
cBlast.GetBlastInfo();
其中C4DSPBlast cBlast;
下面的代码显示C4DSPBlast是一个类。现在,在调试的时候,我发现我在这个语句cBlast.GetBlastInfo()上得到了错误;
但是由于我不知道C语言中的类,所以我在这里发布它,因为我在调试中没有进一步的进展。
class C4DSPBlast
{
public:
//! empty constructor.
C4DSPBlast(void);
//! empty destructor.
~C4DSPBlast(void);
//! Get BLAST information from the hardware(firmware).
/*!
* Read the BLAST information from an the PCI memory attached to the hardware device. This function populates internal class members with this information.
* @return CBLAST_IO_ERROR_BLAST_INFO_RD, CBLAST_NO_DEV_TYPE or CBLAST_SUCCESS if no errors.
*/
int GetBlastInfo(void);
//! m_valBLASTRegister the standard BLAST information register.
union { BLASTReg m_BLASTRegister; unsigned long m_val0; } m_valBLASTRegister;
//! m_valBLASTRegisterExt the extended BLAST information register.
union { BLASTReg m_BLASTRegisterExt; unsigned long m_val1; } m_valBLASTRegisterExt;
//! The whole BLAST information populated by GetBlastInfo() as a C data structure.
struct BOARD m_cBoard;
};
最佳答案
代码是C++。把它编译成C++,错误就会消失。