Warning: "possible use of uninitialized variable 'Arraysize'"

 

Hey, Thanks for taking the time!

I have had this warning a couple of times, and also fixed it but I have no idea how I did it.

But this time I don't know what I am doing wrong. 

//---    Input calculations
double      redCandle        = open > close;                   //--  Defining what a redCandle is
double      greenCandle      = close > open;                   //--  Defining what a greenCandle is

void OnInit()
{   
   int Arraysize;
   if(redCandle || greenCandle){Arraysize++;}
....
}

Thanks in advance! 

Have a great rest of your day, 

 
Foenkelito: Hey, Thanks for taking the time! I have had this warning a couple of times, and also fixed it but I have no idea how I did it. But this time I don't know what I am doing wrong. Thanks in advance! Have a great rest of your day, 

The warning message is clear. You did not initialise the variable, so initialise it.

int Arraysize = 0;
 
Fernando Carreiro #:

The warning message is clear. You did not initialise the variable, so initialise it.

Thank you sir! 

 
Foenkelito #: Thank you sir! 
You are welcome!
Reason: