Forward Referencing of Static Variables OK?

BEATTIE twb at hoqam.UUCP
Thu Oct 10 04:11:13 AEST 1985


> 
> From the way I read K&R, the "static" keyword is redundant, unless
> it is inside a function.  In other words, "static int thing;" is
> equivalent to "int thing;" unless the declaration takes place inside
> a function.  (Any comment on that??)
> 

In K&R, page 80:
	"An external static variable is known within the remainder
	of the source file in which it is declared, but not in any
	other file"

"Regular" external variables can be declared in one file and
referenced in another thru the "extern" statement.

Tom.
~!{ihnp4|hou2g|allegra|mhuxh}!hoqam!twb
Snacktrek - n. The peculiar habit, when searching for a snack, of
constantly returning to the refrigerator in hopes
that something new will have materialized.



More information about the Comp.lang.c mailing list