How the OOP Print can right!

 
//+------------------------------------------------------------------+
//|                                                      OOPTest.mq4 |
//|                        Copyright 2020, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2020, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+
#include <Arrays\ArrayObj.mqh>
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
{
//---

}

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
class test:public CObject
{
public:
                     test(void);
                    ~test(void);

   int               a;
   int               b;
private:
   int               m_a;
};
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void test::test(){}

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void test::~test(){}
 
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
class CTests:public  CArrayObj
{
   
public:
                     CTests(void);
                    ~CTests(void);

};
 CTests *tss;
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void  CTests::CTests() {}
void  CTests::~CTests() {}
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int OnInit()
{
   
   tss=NULL;
   
   EventSetTimer(60);
   tss=new CTests;

   test *ts1=new  test;
   test *ts2=new  test;

   ts1.a=1;
   ts1.b=2;
   
   ts2.a=11;
   ts2.b=22;
      
   tss.Add(ts1);
   tss.Add(ts2);
   
   test *ts=new test;
   
   ts=tss.At(1);
   Print(ts.b);
   
   ts2.b=33;
   //test  *tsb=new test;
   
   //tsb=tss.At(1);
  // Print(ts.b); 
   
   delete ts1;delete ts2;
   
  
   return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//--- destroy timer
    
   delete tss;
//---
   EventKillTimer();

}
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
{
//---
      test *tsTest=new  test;
        //**********************how to write can right print 33
      tsTest=tss.At(tss.Total()-1);

      Print(tsTest.b);
    

}
//+------------------------------------------------------------------+
//| Timer function                                                   |
//+------------------------------------------------------------------+
void OnTimer()
{
//---

}
//+------------------------------------------------------------------+

通过MQL5社区和服务探索MetaTrader 5的新机遇
通过MQL5社区和服务探索MetaTrader 5的新机遇
  • www.mql5.com
MQL5:MetaTrader 5客户端内置的交易策略语言。语言允许编写您自己的自动交易系统,技术指标,脚本和函数程序库
 
ah2005:

No question asked. Title unclear.

If you want to see the correct number of digits, convert it to a string with the correct/wanted accuracy.
          question about decima of marketinfo() - MQL4 programming forum (2016.05.18)