Re: Use of static ?
- From: Christian Bau <christian.bau@xxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 15 Oct 2005 22:47:15 +0100
In article <1129328054.840161.134400@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
codefixer@xxxxxxxxx wrote:
> Hello:
>
> I am trying to understand the use of static in this program.
> http://nanocrew.net/sw/nscdec.c for "inverse" matrix.
>
> What difference would it make if it were not static and just "const
> unsigned char inverse[ 128 ]" in global space which it already is ?
Do you think nobody else would ever have the idea to use an array named
"inverse" ?
Use of the "static" keyword means that this one file is the only place
where the "inverse" matrix is used. If you want to change the algorithm
used, and therefore change the size or contents of the "inverse" matrix,
you would have to check every single source code file whether it
accesses that array or not. Making it static means you have to check
only that one file.
.
- References:
- Use of static ?
- From: codefixer
- Use of static ?
- Prev by Date: Re: please tell the websites
- Next by Date: Re: pointers to char
- Previous by thread: Re: Use of static ?
- Next by thread: Re: char=int
- Index(es):
Relevant Pages
|