Declaring variables mid-function
David Wragg
dpw@doc.ic.ac.uk
Sun Dec 19 04:01:00 GMT 1999
Jamie Walker <jamie@sagaxis.co.uk> writes:
> In standard C, you cannot declare variables part-way through any
> function.
Yes you can. ISO C99 was passed a couple of months ago, and allows
mid-block declarations.
Of course, there are no compilers available yet that comprehensively
implement C99, and probably won't be for a couple of years (though
mid-block declarations will probably be one of the first C99 features
to appear). And people will be using C89 compilers for many years to
come, so you probably shouldn't expect to take advantage of C99
features for a while yet...
So get used to being specific about C89 or C99, rather than just
"standard C".
David Wragg
More information about the Gcc-help
mailing list