Variables' Scope

show code.
your local variable is re-initialized with every loop.

loop() {
    int i = 0;
    i++;
}

i will never be 2.