C++ Single class definition

closed account (G26pX9L8)
In the project I'm currently working on I define a class that only inherits from a parent class and takes one argument. Does this class need to be defined in the header or source file? I read different answers around the internet.
Or is it better to always split definition and logica, even for something like an operator?
Last edited on
A class specification describes the interface to objects of this class. If you'll need your classes specification anywhere else than in its implementation file, then you'll better put it into a header file. Otherwise there's no way to describe other classes your interface.

Its common to use one header and one implementation file for each class.
Topic archived. No new replies allowed.