|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
hello,
I am refactoring a c++ project and I found an header file full of implemented classes. I was wandering if is this right or if there could be a better standard like: 1. Creating different header file for each class that was implemented. 2. Put on a single header file just the definition of all the implemented classes and then use a single .cpp file to implement all of them. 3. Create a different header file for each implemented class and put there only the declaration, while implemetation on many cpp file as many are the classe/hederfile. Unfortunally I am quite confused about all that.... Any will be very appreciate Thanks Disinfo |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
disinfo wrote:
> hello, > I am refactoring a c++ project and I found an header file full of > implemented classes. > I was wandering if is this right or if there could be a better standard > like: > > 1. Creating different header file for each class that was implemented. > > 2. Put on a single header file just the definition of all the implemented > classes and then use a single .cpp file to implement all of them. > > 3. Create a different header file for each implemented class and put > there only the declaration, while implemetation on many cpp file as many > are the classe/hederfile. > > Unfortunally I am quite confused about all that.... > 3) will probably make your life and the lives of those who follow you a lot easier. -- Ian Collins. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Il Tue, 08 Apr 2008 21:05:41 +1200, Ian Collins ha scritto:
>3) will probably make your life and the lives of those who follow you a >lot easier. lolThank you a lot Ian! Just to be sure I make an example If I have an header and some .cpp file and on the header file I 've 5 classes implemented, now I'll create 5 new header file(one for each classes) just with the classes definition and other 5 .cpp files where I'll implement the definition. Am I right? Thanks again Disinfo |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On Apr 8, 2:18pm, disinfo <spikeh...@katamail.com> wrote:
> > Just to be sure I make an example > If I have an header and some .cpp file > and on the header file I 've 5 classes implemented, now I'll create 5 new > header file(one for each classes) just with the classes definition > and other 5 .cpp files where I'll implement the > definition. Am I right? Yes. |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
Il Tue, 08 Apr 2008 08:02:25 -0700, Abhishek Padmanabh ha scritto:
> On Apr 8, 2:18Âpm, disinfo <spikeh...@katamail.com> wrote: >> >> Just to be sure I make an example >> If I have an header and some .cpp file and on the header file I 've 5 >> classes implemented, now I'll create 5 new header file(one for each >> classes) just with the classes definition and other 5 .cpp files where >> I'll implement the definition. Am I right? > > Yes. ![]() thank you! |
|
![]() |
| Outils de la discussion | |
|
|