mql5 About class type variables and function arguments * in a class

 
Hello. I am a beginner in programming.
I heard that MQL5 is based on the concept of the C++ programming language, so I searched the net for C++ and learned about it, but I just couldn't understand the following, so I asked in the forum. Please help me. I'm using a translation tool to convert it to English.

MQL5 Reference>Common Functions>GetPointer (https://www.mql5.com/en/docs/common/getpointer)

I'm trying to decipher the GetPointer example, but I can't figure out the following part.

//+------------------------------------------------------------------+
//|                                             Check_GetPointer.mq5 |
//|                        Copyright 2009, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "2009, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
 
//+------------------------------------------------------------------+
//| Class implementing the list element                              |
//+------------------------------------------------------------------+
class CItem
  {
   int               m_id;
   string            m_comment;
   CItem*            m_next;
public:
                     CItem() { m_id=0; m_comment=NULL; m_next=NULL; }
                    ~CItem() { Print("Destructor of ",m_id,
                                     (CheckPointer(GetPointer(this))==POINTER_DYNAMIC)?
                                     "dynamic":"non-dynamic"); }
   void              Initialize(int id,string comm) { m_id=id; m_comment=comm; }
   void              PrintMe() { Print(__FUNCTION__,":",m_id,m_comment); }
   int               Identifier() { return(m_id); }
   CItem*            Next() {return(m_next); }
   void              Next(CItem *item) { m_next=item; }
  };
//+------------------------------------------------------------------+
//| Simplest class of the list                                       |
//+------------------------------------------------------------------+
class CMyList
  {
   CItem*            m_items;
public:
                     CMyList() { m_items=NULL; }
                    ~CMyList() { Destroy(); }
    bool             InsertToBegin(CItem* item);
    void             Destroy();
  };
//+------------------------------------------------------------------+
//| Inserts list element at the beginning                            |
//+------------------------------------------------------------------+
bool CMyList::InsertToBegin(CItem* item)
  {
   if(CheckPointer(item)==POINTER_INVALIDreturn(false);
//---
   item.Next(m_items);
   m_items=item;
//---
   return(true);
  }
//+------------------------------------------------------------------+
//| Deleting the list by deleting elements                           |
//+------------------------------------------------------------------+
void CMyList::Destroy()
  {
//--- service pointer to work in a loop
   CItem* item;
//--- go through the loop and try to delete dynamic pointers
   while(CheckPointer(m_items)!=POINTER_INVALID)
     {
      item=m_items;
      m_items=m_items.Next();
      if(CheckPointer(item)==POINTER_DYNAMIC)
        {
         Print("Dynamyc object ",item.Identifier()," to be deleted");
         delete (item);
        }
      else Print("Non-dynamic object ",item.Identifier()," cannot be deleted");
     }
//---
  }
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
   CMyList list;
   CItem   items[10];
   CItem*  item;
//--- create and add into the list a dynamic object pointer
   item=new CItem;
   if(item!=NULL)
     {
      item.Initialize(100,"dynamic");
      item.PrintMe();
      list.InsertToBegin(item);
     }
//--- add automatic pointers into the list
   for(int i=0; i<10; i++)
     {
      items[i].Initialize(i,"automatic");
      items[i].PrintMe();
      item=GetPointer(items[i]);
      if(CheckPointer(item)!=POINTER_INVALID)
         list.InsertToBegin(item);
     }
//--- add one more dynamic object pointer at the list beginning
   item=new CItem;
   if(item!=NULL)
     {
      item.Initialize(200,"dynamic");
      item.PrintMe();
      list.InsertToBegin(item);
     }
//--- delete all the list elements
   list.Destroy();
//--- all the list elements will be deleted after the script is over
//--- see the Experts tab in the terminal
  }

(1)

Is it correct to recognize that a pointer variable (CImte *m_next) in a class does not change its value even if it is referenced by an instance of the same class type?  (Yellow marker part)

However, this leaves the question of which key is the key of the associative array.
The reason is that the object descriptor is stored in m_items so that the reverse order of object creation is achieved with m_items=m_items.Next(); in the Destroy method.


(2) 

Class type* method name in the class (CItem *Next()) is a method that is not a basic data type, so I don't understand what it means. (Blue marker part)
How should I interpret it?


(3) 

In the above script (red marker part), the argument of the InsertTobegin method is (class type * variable name), so It seems to me that you are passing a pointer, is there any mistake in this perception?

It's also prohibited to pass the pointer as a function argument. In all these cases the compiler will notify an error.

If there is no problem with recognition, does this mean that it is okay to pass pointers, although the notes on the relevant page mention this?