if(int i; i < 2; i++)
Local variables are not initialized by default. You MUST supply an initial value. Zero is generally a good choice.
if(int i; i < 2; i++)
Local variables are not initialized by default. You MUST supply an initial value. Zero is generally a good choice.