In the C programming language, it is my understanding that variables can only be defined at the beginning of a code block, and the variable will have the scope of the block it w
You don't even need an if statement. You can create blocks with {}
That should probably be a separate function however.
Example here:
#include int main(int argc, char **argv) { int i = 0; { int i = 10; printf("%d\n", i); } printf("%d\n", i); }