This is probably a simple question for most of you, but I was just wondering about the rules regarding where variables (inside functions) can be declared?
I always thought they could only be declared at the top of a function before any real code, but I've seen variables declared further down in some C code (like inside loops...).
Also, do different versions of C (like C99...) support putting variable declarations in different spots?
And one other thing... what about variable initialization rules? Can any variable be initialized when it's declared (assuming other declarations follow it), or just ints?