Just like Richard, I can't understand the given error message with main() here.
The code shown here could report an error here:
int arr[n];
1> error C2057: Constant expression expected.
1> error C2466: Assignment of an array of constant size 0 not possible.
1> error C2133: "arr": Unknown size
The Variable dynamic arrays feature is supported only by newer C compilers and C versions.
However, you can easily eliminate the bug by allocating the memory dynamically.