what the different abount const

 
class test
{
public:
                     test(void);
                    ~test(void);
   
   int             constTest(const int a) const;
   int             constTestb(const int a);
   int             constTestc(const int a) const {return(a);}
   
};



so ,somebody can geive a example what the dfiierent on  constTest!



 
nobody know it?
 
Documentation on MQL5: Language Basics / Object-Oriented Programming / Static Members of a Class
Documentation on MQL5: Language Basics / Object-Oriented Programming / Static Members of a Class
  • www.mql5.com
Static Members of a Class - Object-Oriented Programming - Language Basics - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Short version:

Const variables can be initialized once and not be altered afterwards.

When declaring an object as const, only const members can be called.

Const member functions may not alter the object.