variables: "Implicit initialization is not used."

 

Hi,

a question, just to be sure that it is meant what I assume:

Am I right, that (in contrary to mq4) variable don't get a value 0 on their definition:

// in mq4:
int i; // i == 0 - at least last year

//in mq5
int i; // i == random 

It could be just another trap of the code-migrating mq4 =0 mq5.

Thanks!

 
What the documentation says ?
 
Alain Verleyen:
What the documentation says ?
"Implicit initialization is not used."
 
Carl Schreiber:
"Implicit initialization is not used."

You are right carl, you have to set it to 0 

int i =0;

 

In MT4 without the use of strict, variables are initialized to zero by default. With only global variables.
          Updated MQL4 - MQL4 Reference

In MT5 there is no implicit initialization
          Language Basics / Variables / Initialization of Variables - Reference on algorithmic/automated trading language for MetaTrader 5