Re: visibility of variable



Michael Mair wrote on 26/09/05 :
Emmanuel Delahaye wrote:
rahul8143@xxxxxxxxx wrote on 26/09/05 :

    To limit scope of a variable in a single file that is part of a
large project that have several  C files we use static variable
right?then to limit any variable to function scope it should be
declared as auto or anything else?

There is no 'function scope'.

There _is_ function scope. Function scope is what labels are visible in.

There is 'block scope'. A variable defined in a block has the block scope. If it has the 'static' qualifier, it becomes persistent.

Right.

Cheers
  Michael

labels ? goto ? Sorry, I don't code in assembly nor in BASIC anymore ;-)



-- Emmanuel The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html The C-library: http://www.dinkumware.com/refxc.html

I once asked an expert COBOL programmer, how to
declare local variables in COBOL, the reply was:
"what is a local variable?"


.