0

Helo frndz,

I'm a nob in c++....So, I want to know about default constructor. How to create? Why default constructor? How to create a no-arg constructor that creates a default triangle??...Plz help...

Thnx...

3
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by baula
0

The default constructor is just used when no other constructors have been declared. To create a no-arg constructor (override the default constructor):

class MyClass {
public:
    MyClass();
};

MyClass::MyClass() {
    //some code...
}
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.