Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

difference between C and C++ / Class in C

Status
Not open for further replies.

syedshan

Advanced Member level 1
Joined
Feb 27, 2012
Messages
463
Helped
27
Reputation
54
Reaction score
26
Trophy points
1,308
Location
Jeonju, South Korea
Activity points
5,134
Dear all,

I have a vendor specifc code for ADC and other peripherals.
Now using it I am understanding the flow.

the extension of the files are .cpp but the statements there are similar to C rather C++
i.e. printf() is used instead of cout;
no namespace.std defined... also other things which made me sure that it is a c-language code.
(pardon me but whatever I ask the vendors but response is quite late from there)

So it is a complete C- code. But while understangin I came to a point where the class is defined and I am really puzzled now. Since I have not seen or heard any one using class

Code:
 C4DSPBlast cBlast;
  cBlast.GetBlastInfo();

where C4DSPBlast cBlast;

and following code shows that C4DSPBlast is a class. Now, while debugging, I found that I am getting error at exactly this statement cBlast.GetBlastInfo();
but since I don't know the classes in C- I post it here since I am not getting any forward any further in debugging.

Code:
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;
};
 

Hi,

well classes are C++, not C. The only thing that is similar to (but very different from) C++ classes in C are structs. However, back to your question: which compiler are you using? And, aboveall, which error is shown to you by the compiler?

Cheers
 

Hmm...

Thank you for your reply.
Well I too think it was the same as you mentioned.
Well the pop-up screen appears as the program reaches that point. Indicating that your program is not performing Debug or close...typical windows 7 error.
I am using visual studio 2010

Bests,
Shan
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top