User imput string int and float[DOUBT]

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Feb 15 18:17:49 PST 2017


On 02/15/2017 05:49 PM, Jean Cesar wrote:

 > So I'm a beginner in this language and have very little time I started
 > I'm interested in apprehending concepts of object orientation
 > polymorphism inheritance, multiple inheritance as in c ++

D is similar to C++ but also very different.

 > but I did not
 > understand how to use constructor in it
 > Because I simply did.
 >
 > Class person
 > {
 >    person(){}
 >    ~ Person () {}
 > }
 >
 > And error ...

In D, constructor is always called this():

class Person
{
    this(){}
    ~this() {}
}

void main() {
     auto p = new Person();
}

Ali



More information about the Digitalmars-d-learn mailing list