Should I always use a constructor?

If you don’t implement a constructor, the compiler will implictly create a default constructor if the class needs a constructor. So it depends on what you’re really asking. If you’re asking if you can write a class without explicitly creating a user defined constructor, yes you can do that.

Read more

Are default constructors necessary?

The compiler-defined default constructor is required to do certain initialization of class internals . It will not touch the data members or plain old data types (aggregates like an array, structures, etc…). However, the compiler generates code for the default constructor based on the situation.9 Oca 2022

Read more