Re: visibility of variable
- From: "Emmanuel Delahaye" <emdel@xxxxxxxxxxxxxx>
- Date: Mon, 26 Sep 2005 21:33:45 +0200
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?"
.
- Follow-Ups:
- Re: visibility of variable
- From: Eric Sosman
- Re: visibility of variable
- References:
- visibility of variable
- From: rahul8143
- Re: visibility of variable
- From: Emmanuel Delahaye
- Re: visibility of variable
- From: Michael Mair
- visibility of variable
- Prev by Date: Re: I don't quite understand this exercise...
- Next by Date: Re: Generate All Subsets
- Previous by thread: Re: visibility of variable
- Next by thread: Re: visibility of variable
- Index(es):