You have to specify the datatype of the array.
Is it long, int, double, string, datetime ?
The compiler isn't good at guessing.
You have to specify the datatype of the array.
Is it long, int, double, string, datetime ?
The compiler isn't good at guessing.
Why the docs then does not specify the datatype in their example
https://www.mql5.com/en/docs/array/arrayresize
Can you give the solution for this case in the code please?
Thanks

- www.mql5.com
Why the docs then does not specify the datatype in their example
https://www.mql5.com/en/docs/array/arrayresize
Can you give the solution for this case in the code please?
Thanks
ArrayResize() can't be on global scope.
ArrayResize() can't be on global scope.
Thank you.
This code's error is 'declaration without type', Any idea why and how to fix it? Thanks
Do not double post. It is annoying and can waste people's time.
I have deleted your other post
This code's error is 'declaration without type', Any idea why and how to fix it? Thanks
input int days=3; class Session; Session *session[]; const int Init = ArrayResize(session, days); // OK
Useless.
You just do not understand.
You just do not understand.
Of course, I don't understand anything from you. :-)
Are you answering to help people or ... ? Please explain us what can be the usage of using ArrayResize() on the global scope using a "const int" ?
Of course, I don't understand anything from you. :-)
Are you answering to help people or ... ? Please explain us what can be the usage of using ArrayResize() on the global scope using a "const int" ?
Run
input int days=3; class Session { public: Session() { Print(__FUNCSIG__); } }; Session session[]; const int Init = ArrayResize(session, days); // OK int OnInit() { Print(__FUNCSIG__); return(INIT_FAILED); }
Result
void Session::Session() void Session::Session() void Session::Session() int OnInit()
ArrayResize before OnInit. This is useful, for example, here.

- www.mql5.com

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
This code's error is 'declaration without type', Any idea why and how to fix it? Thanks