When you turn on your computer, it does a bunch of stuff, right? POST, loading the OS, logging you in, starting up automatic programs, etc... Constructors have a similar purpose in that they put your objects into an initial ready state. Achieving that state would be cumbersome at best (because you have to set every data member) and impossible at worst (if you have private data in the class).
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Offline 11,807 posts
since Sep 2004