Constructor : A constructor is a member function which is call automatically When Object is created.
There Are Many Types Of constructor?
- copy
- Default
- Parameterized
Syntax : class class_name
{
constructor ( ); // Define constructor
};
Example:
class A
{
int i;
public();
A();
}
A : A();
{
i=1;
0 comments:
Post a Comment