Hello all.
I am new to c++ and and our teachers have started Object oriented programming.. I am facing real trouble in understanding the concepts of constructor and destructor. Why are they used and how are they used..
Please post...
shauzi158
-4
Newbie Poster
Recommended Answers
Jump to PostWhat are some of your thoughts, then someone can either confirm them or make corrections.
Jump to PostNot when the program is started, but when the object is created.
How about the destructor for a class that doesn't do any memory allocation?
What happens when you don't specify a constructor for the class?
Jump to Postif i would've known the answer, i wouldn't had started the thread......
Me telling you the answer doesn't help you learn anything. I'm just asking you some follow up questions, I'm not expecting that you're going to know everything
If you include a destructor with nothing in the body …
All 10 Replies
jonsca
1,059
Quantitative Phrenologist
Team Colleague
Featured Poster
shauzi158
-4
Newbie Poster
jonsca
1,059
Quantitative Phrenologist
Team Colleague
Featured Poster
shauzi158
-4
Newbie Poster
jonsca
1,059
Quantitative Phrenologist
Team Colleague
Featured Poster
shauzi158
-4
Newbie Poster
jonsca
1,059
Quantitative Phrenologist
Team Colleague
Featured Poster
Fbody
682
Posting Maven
Featured Poster
jonsca
1,059
Quantitative Phrenologist
Team Colleague
Featured Poster
floatingDivs
21
Junior 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.