#include<iostream.h>
#include<conio.h>
class citizen
{
private:
const char name[25];
char nationality[25];
public:
citizen() //first constructor with no parameter
{
name="Farhan";
nationality="PAkistani";
}
citizen(char a, char b)//second constructor
{
name=a;
nationality=b;
}
~citizen() // destructor
{
cout<<"\n Destructor called";
}
void display()
{
cout<<name;
cout<<"\n"<<nationality;
}
};
void main()
{
clrscr();
citizen a;
}
The output should be the following
Farhan
Pakistani
Mark
australian
Whare
Farhan
pakistani
are the initialized agaubst tge constructor with no parameter
Mark
Australian
are the initialized vaues against the constructor with to parameter mark
australian