January 20th, 2003, 01:20 AM
Why Constructor function has same name as Class? Is there any valid point ? Why it should not have different name?
January 20th, 2003, 10:49 AM
A contructor function has the same name as the class because it is to be called when the object is created. This is done so that you don't have to call a seperate function at that time, just create the object and it calls this function automatically.
January 20th, 2003, 12:40 PM
if you donīt like it, try another programming language.
in delphi eg. you can name the constructor / destructor whatever you want... the result is, that unlike C++, you have to tell which constructor to use:
February 2nd, 2003, 12:26 AM
I like it one less line of code to type....::D