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.

Question about classes in C++

Status
Not open for further replies.

Lucifre

Full Member level 2
Joined
Jul 5, 2005
Messages
125
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,296
Location
Detroit MI
Activity points
2,389
My book states that class methods must always be defined in a source file.
is it possible to define a class and its method definitions in a single header file?
If i am not wrong string is a class, and u use only a single header file to use it.
 

Lucifre said:
My book states that class methods must always be defined in a source file.
is it possible to define a class and its method definitions in a single header file?
If i am not wrong string is a class, and u use only a single header file to use it.
Yes! This is permissible as long as you only include the header file once in your project. If you include it more than once you will get Duplicate Definition errors.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top