Constructors are mainly used to initialize member data whenever you create an object, right? I've been trying to learn why they're used and I think I finally get it.![]()
This is a discussion on I Think I Finally Get It! within the C++ Programming forums, part of the General Programming Boards category; Constructors are mainly used to initialize member data whenever you create an object, right? I've been trying to learn why ...
Constructors are mainly used to initialize member data whenever you create an object, right? I've been trying to learn why they're used and I think I finally get it.![]()
- Dean
Exactly. Whenver you create an instance of an object, its constructor is called to do whatever tasks you've given it (such as setting values to zero, or whatever. These tasks can be very simplistic, or quite involved.Originally posted by LordVirusXXP
Constructors are mainly used to initialize member data whenever you create an object, right? I've been trying to learn why they're used and I think I finally get it.![]()
Quzah.
Hope is the first step on the road to disappointment.