On Fri, Mar 28, 2003 at 06:25:45PM +1200, Mike Beattie wrote:
> On Fri, Mar 28, 2003 at 06:18:04PM +1200, David Mann wrote:
> > >         char * sQuote;
> > 
> > I declare all my local variables at the start of the function (ie where 
> > you declare 'myfile').  Its easier to keep track of them.

> Indeed. also, gcc wont accept variables declared anywhere except the start
> of a block. (not sure about other compilers).

C99 is almost completely supported by gcc (depending on which version of
gcc you're using, of course), and the C99 spec does allow declarations
anywhere in a block.  So gcc will allow you to declare variables
anywhere in a block if it's in C99 mode, which modern versions will
default to.

Cheers,
-mjg
-- 
Matthew Gregan                     |/
                                  /|                [EMAIL PROTECTED]

Reply via email to