cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
user name:
password:
Forgot your password?
please wait
try again
cancel
forgot your password?
sign up
log in
[Legacy version]
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
derived class files
derived class files
Nov 29, 2019 at 2:36pm
Nov 29, 2019 at 2:36pm UTC
ema897
(80)
Hi!
I have a base class from which I want to derive many derived classes.
Where should I put the derived classes? In the same .h of the base class or do I need a .h (and so .cpp) file for each of them?
Nov 29, 2019 at 3:39pm
Nov 29, 2019 at 3:39pm UTC
jlb
(4973)
Where should I put the derived classes?
This really a design question that has no real "correct" answer. C/C++ does not require classes to be in their own header and source files.
You can either put each class in it's own header and source file or have more than one class in you header or source files, your call.
Topic archived. No new replies allowed.