clear struct array

 

Hi,

i want to ask on how to clear the array.

struct TradeData
{
        string comment;
        string symbol;
        string ticket;
        double lots;
        double openprice;
        int activated;
}

TradeData TrdData[11];

After putting data on the array, if all conditions are met, array should clear of all the value. What i did was:


TrdData[0].comment=NULL;
TrdData[0].symbol=NULL;
TrdData[0].ticket=NULL;
TrdData[0].lots=NULL;
TrdData[0].openprice=NULL;
TrdData[0].activated=NULL;


Do you have any better solution for this.


Thanks...

 
Documentation on MQL5: Common Functions / ZeroMemory
Documentation on MQL5: Common Functions / ZeroMemory
  • www.mql5.com
Common Functions / ZeroMemory - Reference on algorithmic/automated trading language for MetaTrader 5