Constructors.

ClassName(int l=3, int b=5, int h=8)
{
length=l;
breadth=b;
int height=h;
}

is this a constructor with no parameters?
a constructor with no default parameters
ref: http://www.cplusplus.com/doc/tutorial/classes/ (and also classes part 2)
no its not
closed account (zb0S216C)
No. You can clearly see that ClassName has arguments. A constructor without arguments will be like this:
1
2
3
4
5
6
7
8
9
class ClassName
{
    ClassName( void );  // void doesn't have to be there. 
};

ClassName::ClassName( void )
{
    // ...
}
Topic archived. No new replies allowed.