我有 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;
};