thanks paul
if ignorance is bliss then knock the smile off my face!!!
thanks paul
if ignorance is bliss then knock the smile off my face!!!
thanks for the reply led mike :D i have rewritten my classes into baseClass.hpp, CatClass.hpp, and DogClass.hpp with farms.cpp initialising the functions and having main() i had a lot of trouble compiling as it kept saying i had already declared my Mammal class in baseClass however if you add [code]#ifndef BASE_CLASS_HPP #define BASE_CLASS_HPP[/code] at the top of baseClass.hpp and [code]#endif[/code] at the bottom it works. you all probably already new that but i've just wasted 2 1/2 hours of my life learning that the hard way:D thanks again paul
if ignorance is bliss then knock the smile off my face!!!
can i add a quetion on the end? i have a base class animalClass.hpp i have a derived Dog class and main in dogObj.cpp and a derived Cat class in catObj.cpp what i wanted to know is should i have animalClass.hpp dogClass.hpp, catClass.hpp, declaring the classes and have a seperate animalObj.cpp for main() to constrol the functions etc? at the moment my animalClass is about fifty lines as are the other animal classes, with my main () about 80 lines thanks in advance paul
if ignorance is bliss then knock the smile off my face!!!
i thought that was what was happening and wondered why use A and B?? i am only a learner myself:-O i am on leave all week so any day suits me:-D paul
if ignorance is bliss then knock the smile off my face!!!
sorry led mike i thought you just posted and it joined the rest i wasn't posting to you :confused: why wouldn't you inherit? paul
if ignorance is bliss then knock the smile off my face!!!
i would have thought so as you haven't freed it explicitly, or your compiler has done it for you, why don't you put cout << "destructor\n"; in your destructor and see? paul
if ignorance is bliss then knock the smile off my face!!!
i don't understand what the question is?? if you have an Animal base class and you want to derive a Dog from it surely you would put class Dog : public Animal { };
or is that not the question you're asking? i am only a learner myself but if you're asking is it right or wrong, no there is no answer whichever you're most comfortable with hth paul
if ignorance is bliss then knock the smile off my face!!!