Should one declare variables (in C) at the begining of a function? I allways declared them before the first use, now i start to question if this is right.
What is the right thing to do /prog/?
If the code you're writing is strict C89, then you should do it at the beginning of the code block. If it's something newer that allows declaring it in random places, then do whatever you wish. I tend to declare it at the beginning, since I like compatibility with a lot of compilers (for example, MS' Optimizing C compiler (MSVC's) tends to be C89-only in its C mode. Of course I could just use C++ mode, but I'd rather not).