#include<iostream>
#include<string>
using namespace std;
class Employee{
      private:
         char *name;     
      public:
         Employee(char *s){
             cout<<"constructor is called \n"<<endl;          
             int length = strlen(s);
             name = new char [length+1];
             strcpy(name, s);
         }
         void display(){
            cout<<"Name : "<<name<<endl;        
         }
         ~Employee(){
            cout<<"Destructor is called \n"<<endl;         
            delete [] name;
         }                  
      }; 
void abc(){
    Employee e("Ahmad Ali");
    e.display();
}
main(){
    abc();
    system("pause"); 
}


/*
class Time
{
  private:
    int hour;   // 0 - 23 (24-hour clock format)
    int minute; // 0 - 59
    int second; // 0 - 59
  public:
    Time( int h = 0 , int m= 0 , int s = 0){
      setTime( h, m, s );  
    }
    // set functions
    void setTime( int h, int m, int s){ // set time
      setHour( h );
      setMinute( m );
      setSecond( s );
    }
    void setHour( int h){ // set hour
      hour = ( h >= 0 && h < 24 ) ? h : 0;  
    }
    void setMinute( int m){ // set minute
      minute = ( m >= 0 && m < 60 ) ? m : 0; 
    }
    void setSecond( int s){ // set second
      second = ( s >= 0 && s < 60 ) ? s : 0;
    }
    // get functions (normally declared const)
    int getHour() const{ // return hour
      return hour;
    }       
    int getMinute() const{ // return minute   
      return minute; 
    }
    int getSecond() const{ // return seco
      return second;
    }
    // print functions (normally declared const)        
    void printTime() const{
      cout<<hour<<" : "<<minute<<" : "<<second<<endl;      
    }
};
main(){
  Time *timePtr;
  timePtr = new Time(18, 16, 45);
  
  timePtr->printTime(); 
  (*timePtr).printTime();
  delete timePtr;
  
  system("pause");     
}
*/
