PROGRAM ON DEFINING A CLASS ADDRESS USING CONSTRUCTOR.

#include<iostream.h>
#include<conio.h>
#include<string.h>
Class ADDRESS
{
      char name[20];
      int hno;
      char street[15];
      char city[10];
      char state[10];
      public:
      ADDRESS()
      {
               strcpy(name,’BLANK’);
               hno=0;
               strcpy(street,’BLANK’);
               strcpy(city,’BLANK’);
               strcpy(state,’BLANK’);
      }
      ADDRESS(char name1[15],int hno1,char street1[20])
      {
              strcpy(name,’name1’);
              hno=hno1;
              strcpy(street,’street1’);
              strcpy(city,’DELHI’);
             strcpy(state,’INDIA’);
       }

};

Comments

Popular Posts