Please explain.
Does it automatically include the default constructor?
lotrsimp12345
37
Posting Pro in Training
Recommended Answers
Jump to Postdo you mean if you don't explicitly create a constructor in your class, or are you referring to constructor overloading?
if it's that you don't explicitly create your own, here's what happens
#include <iostream> //feel free to give this a test to see for yourself, it …
Jump to PostIf you do not explicitly define a constructor for your class, the program will call the default constructor. This is not recommended as your variables will contain random value. Constructor and destructor are highly recommended to carefully handle memory (constructor - to initialize values of variable before they are used)
…
All 7 Replies
jesseb07
64
Junior Poster
chiwawa10
77
Junior Poster
mrnutty
761
Senior Poster
lotrsimp12345
37
Posting Pro in Training
DangerDev
107
Posting Pro in Training
Laiq Ahmed
42
Junior Poster
DangerDev
commented:
very informative.
+3
packrisamy
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.