How do you call a constructor from another constructor in CPP?

No, in C++ you cannot call a constructor from a constructor . What you can do, as warren pointed out, is: Overload the constructor, using different signatures. Use default values on arguments, to make a “simpler” version available.

Sizin İçin Seçtik  Is constructor overloading possible if yes then explain and if no then why?

Leave a Reply

Your email address will not be published. Required fields are marked *