January 20th, 2003, 12: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, 09: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, 11:40 AM
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 1st, 2003, 11:26 PM
I like it one less line of code to type....::D