C++ convenetions - source and header files for a class -


i'm new cpp, want use object dog, ok use header file class dog? methods implemented in inline manner.
or should partition class header , cpp file implementing methods defined in header file?
class dog used in other cpp file (as concrete object , not pointer - dog dog = new dog()...).

is ok use header file class dog?

yes, ok.

but when programs getting larger, it's more practical separate declaration implementation , organize program semi-independent code fragments, can used minimize compilation times , chance of errors.


Comments

Popular posts from this blog

c++ - list<myClass<int> * > sort -

c - Defining floating point constants, how many digits are useful? -