how many class can contain a header | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

how many class can contain a header

6th Nov 2016, 11:50 AM
charles mamy
charles mamy - avatar
3 Answers
+ 2
As many as u want
8th Nov 2016, 3:55 AM
Khwaja Hussam Quasmi
Khwaja Hussam Quasmi - avatar
+ 2
you can add as many classes as you want . To state it in a professional way and for best practice, Add just one super/parent class and the rest should be a sub/child class.
11th Nov 2016, 7:08 PM
Franky BrainBox
Franky BrainBox - avatar
+ 1
One Header file can include as much classes/definitions as you wish. Note that you have to include your *.hpp in your *.cpp which means you not even need the same name here! In sake of readability you should only put classes/definitions in the header file they belong...
6th Nov 2016, 12:39 PM
Gunther Strauss
Gunther Strauss - avatar