Questions about object pointers and memory management

//test.h

#ifndef TEST_H_
#define TEST_H_
#include<iostream>

class ABC
{
    private:
    char mode;
    public:
    ABC(char m);
    ABC(const ABC & a);
    ABC(){mode='0';};
    virtual ~ABC(){};
    virtual void View();
    ABC & operator=(const ABC &);
    friend std::ostream & operator <<(std::ostream & os,
                                    const ABC & rs);
};

class baseDMA:public ABC
{
    private:
    char * label;
 

    public:
    baseDMA(const char * l ,char m);
    baseDMA(const char * l ,const ABC & a);
    baseDMA(const baseDMA & bs);
    baseDMA();
    ~baseDMA(){delete [] label;};
    baseDMA & operator=(const baseDMA & rs);
    void View();
    friend std::ostream & operator <<(std::ostream & os,
                                    const baseDMA & rs);
};


class lacksDMA:public ABC
{
    private:
      enum{COL_LEN =40};
      char color[COL_LEN];
    public:
      lacksDMA(const char*c="blank",char m='0');
      lacksDMA(const char * c,const ABC & a);
      lacksDMA(const lacksDMA & ls);
      lacksDMA();
      ~lacksDMA(){};
      void View();
      lacksDMA & operator=(const lacksDMA & ls);
      friend std::ostream & operator <<(std::ostream & os,
                                        const lacksDMA &rs);
};

// derived class with DMA
class hasDMA:public ABC
{
    private:
      char * style;
      int cc;
    public:
      hasDMA(const char * s,int cc,char m );
      hasDMA(const char * s,int cc,const ABC & a);
      hasDMA(const hasDMA  & hs);
      hasDMA();
      ~hasDMA(){delete [] style;};
      void View();
      hasDMA & operator=(const hasDMA &);
      friend std::ostream & operator<<(std::ostream &,const hasDMA & rs);
};

#endif
#include"test.h"
#include<iostream>
#include<cstring>

//base
ABC::ABC(char m)
{
    mode=m;
}
ABC::ABC(const ABC & a)
{
    mode=a.mode;
}
   


ABC & ABC::operator=(const ABC & a)
{ 
    mode=a.mode;
    return *this;
}

   std::ostream & operator <<(std::ostream & os,
                                    const ABC & a)
{   
    os << "Mode: " << a.mode << std::endl;
    return os;
}

 void ABC::View()
 {
    std::cout << *this <<std::endl;   //试试用 cout << "Mode: " << mode ;
 }

// mode a

baseDMA::baseDMA(const char * l,char m):ABC(m)
{   
    label=new char[strlen(l)+1];
    strcpy(label,l);
    
}
baseDMA::baseDMA(const char * l ,const ABC & a):ABC(a)
{
    label=new char[strlen(l)+1];
    strcpy(label,l);
   
}
baseDMA::baseDMA(const baseDMA & rs):ABC(rs)
{   
    label=new char[strlen(rs.label)+1];
    strcpy(label,rs.label);
    
}

baseDMA::baseDMA():ABC('0')
{
    label=0;
    
};

baseDMA & baseDMA::operator=(const baseDMA & rs)
{   
    if(this==&rs)
    return *this;
    ABC::operator=(rs);
    delete [] label;
    label=new char[strlen(rs.label)+1];
    strcpy(label,rs.label);
  
    return *this;
}

std::ostream & operator <<(std::ostream & os,const baseDMA & rs)
{
    os<<(ABC)rs << std::endl;
    os << "Label: " << rs.label << std::endl;
    return os;
}

void baseDMA::View()
 {
    std::cout << *this << std::endl;
 }

// mode b
  lacksDMA::lacksDMA(const char*c,char m):ABC(m)
  {
    strcpy(color,c);
  }
  lacksDMA::lacksDMA(const char * c,const ABC & a):ABC(a)
  {
    strcpy(color,c);
  }
      
  lacksDMA::lacksDMA(const lacksDMA & ls):ABC(ls)
  {
    strcpy(color,ls.color);
  }

  lacksDMA::lacksDMA():ABC('0')
  {
    strcpy(color,"blank");
  }
 
  lacksDMA & lacksDMA::operator=(const lacksDMA & ls)
  { 
    if(this==&ls)
    return *this;
    strcpy(color,ls.color);
    ABC::operator=(ls);
    return *this;
  }

  std::ostream & operator <<(std::ostream & os,
                              const lacksDMA &rs)
  {
    os << (ABC)rs << std::endl;
    os << "Color: " << rs.color << std::endl;
    return os;
  }

  void lacksDMA::View()
 {
  std::cout << *this << std::endl;
 }

  // mode c
  hasDMA::hasDMA(const char * s,int c0,char m ):ABC(m)
  {
    style=new char[strlen(s)+1];
    strcpy(style,s);
    int cc=c0;
  }

  hasDMA::hasDMA(const char * s,int c0,const ABC & a):ABC(a)
  {
    style=new char[strlen(s)+1];
    strcpy(style,s);
    cc=c0;
  }

  hasDMA::hasDMA(const hasDMA  & hs):ABC(hs)
  {
    style=new char[strlen(hs.style)+1];
    strcpy(style,hs.style);
    cc=hs.cc;
  }

  hasDMA::hasDMA():ABC('0')
  {
    style=0;
    cc=0;
  }

  hasDMA & hasDMA::operator=(const hasDMA & rs)
  {
    if(this==&rs)
    return *this;
    delete [] style;
    ABC::operator=(rs);
    style=new char[strlen(rs.style)+1];
    strcpy(style,rs.style);
    cc=rs.cc;
    return *this;
  }
    
    std::ostream & operator<<(std::ostream & os,const hasDMA & rs)
    {
        os << (ABC)rs << std::endl;
        os << "Style: " << rs.style << std::endl;
        os << "CC: " << rs.cc << std::endl;
        return os;
    }

      void hasDMA::View()
 {
    std::cout<< *this << std::endl;
 }
#include"test.h"        
#include<iostream>
#include<cstring>
#include<string>
#include<stdlib.h>
const int MODE=3;

int main()
{
    using std::cout,std::endl,std::cin;
    ABC * Pa[MODE];
    char  mode;

    char  label1[40];

    
    char  color1[40];

    char style1[40];
    int cc;
    
    for(int i=0;i<MODE;i++)
    {
        cout <<"Please enter mode: ";
        cin >>mode;
        cin.get();
        
        if(mode=='a')
        {
        cout << "Please enter label: ";
        cin.getline(label1,39);
        baseDMA ba(label1,'a');
        Pa[i]=&ba;
        cout << "aaaaaaaaaaaaaaaaan" << endl;
        }
        else if(mode=='b')
        {   
            
            cout << "Please enter color: ";
            cin.getline(color1,39);
            lacksDMA la(color1,'b');
            Pa[i]=&la;
               
            
            cout << "bbbbbbbbbbbbbbbbbn" << endl; 
        }
        else if(mode=='c')
        {
            cout <<"Please enter style: ";
            cin.getline(style1,39);
            cout << "Please enter CC: ";
            cin >> cc;
            hasDMA ha(style1,cc,'c');
            Pa[i]=&ha;
            
            cout << "cccccccccccccccccccccn" << endl; 
        }
        else
        {
            cout <<"Please enter a,b or c.n";
            i--;
        continue;
        }
        
    }
    
    for(int i=0;i<MODE;i++)
    {
        Pa[i]->View();
    }
    cin.get();
    cin.get();
    return 0;
}

=====================================================

Why does running the program output 3 Mode: b?

Please enter mode: c
Please enter style: cc
Please enter CC: 1
ccccccccccccccccccccc

Please enter mode: c
Please enter style: ccc
Please enter CC: 2
ccccccccccccccccccccc

Please enter mode: b
Please enter color: bb
bbbbbbbbbbbbbbbbb

Mode: b

Mode: b

Mode: b

Don’t tell me that the unpredictable program behavior is caused by the pointer pointing to the object of the released memory. Because this output is obviously regular, if you don’t believe it, you can copy the code and try it. I just don’t understand why the view() function can be called even though the memory has been released, and sometimes the output is repeated.
enter image description hereenter image description here

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật