array pupulating

samjesse

Active Trader
Aug 30, 2011
118
0
27
Hi

Please tell me why this code is reporting Array out of Range error? thx

MQL5:
   double temp[];
   temp[0] = 1.3;

And while at it. Does this language have the pop, push, ...etc for Arrays? I could not locate much help from the docs. Or hash or vectors or...etc...thx
 
Last edited by a moderator:

Enivid

Administrator
Staff member
Nov 30, 2008
19,297
1,529
144
Odesa
www.earnforex.com
Dynamic arrays should be initialized either with ArrayInitialize(), SetIndexBuffer(), or with CopyBuffer() (or its analogues).

As far as I know, pop, push, hash and vectors aren't supported in MQL5. But it looks like it's possible to write your own classes for this functionality. And, probably, such classes already exist somewhere.
 
Last edited: