Evidently you are compiling this as C, not C++. VS doesn't support C99, in which case you may not do this:
for (int i = 0; i < 32; i++)
You need to do this instead:
int i;
...
for(i = 0; i < 32; i++)
Where the declaration of i must come before all statements in the function.