I think you should move the variable declaration to top of block. I.e.
{
foo();
int i = 0;
bar();
}
to
{
int i = 0;
foo();
bar();
}
More Related Contents:
- How I can correct my c code?
- Variable redeclaration in c in loop and outside loop?
- How to resolve a variable for char length? [closed]
- BigInteger in C?
- Why is the asterisk before the variable name, rather than after the type?
- How does an uninitiliazed variable get a garbage value?
- Why are global variables always initialized to ‘0’, but not local variables? [duplicate]
- Concatenating Variable Names in C?
- Where are constant variables stored in C?
- Get warning when a variable is shadowed
- In C, what is the correct syntax for declaring pointers?
- How to place a variable at a given absolute address in memory (with GCC)
- Printing all global variables/local variables?
- shared global variables in C
- C Programming: Forward variable argument list
- Why does fgetc() return int instead of char?
- How are variable names stored in memory in C?
- Programmatic way to get variable name in C?
- C multiple single line declarations
- C variable declarations after function heading in definition [duplicate]
- Varying string variable in an if condition
- How are static variables with the same name in different functions identified by the System?
- Difference between static global variable and non-static global variable in C [duplicate]
- Why do we separately cast to “float” in an integer division?
- declaring variables without any data type in c
- Uninitialized variable in C [duplicate]
- Is bool a native C type?
- How to scanf only integer?
- What is the purpose of a zero length array in a struct? [duplicate]
- Integer overflow in C: standards and compilers