Hi,
A quite basic question I'm afraid. Somehow I had got it into my head that in C all variables must be declared at the start of a function block. Certainly this is convention and I would go so far as to say good practice. But from a quick test using a couple of different compilers it certainly doesn't seem that you have to do this. Was there ever a time when compilers enforced such restrictions or am I going mad?
Thanks.
A quite basic question I'm afraid. Somehow I had got it into my head that in C all variables must be declared at the start of a function block. Certainly this is convention and I would go so far as to say good practice. But from a quick test using a couple of different compilers it certainly doesn't seem that you have to do this. Was there ever a time when compilers enforced such restrictions or am I going mad?
Thanks.