Date: Thu, 24 Apr 1997 15:35:03 +0200 (MET DST) From: Miguel Murillo To: Ian Mausolus cc: djgpp AT delorie DOT com Subject: Re: C & static In-Reply-To: <01bc5055$7a3d2100$08b0f8ce@didi> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On 24 Apr 1997, Ian Mausolus wrote: > > What is the significance of the word "static" in front of a function name > in C? > > for example: > > static void foo(int i) > { > .... > } > > thanx, > > I. Mausolus > Static : function local in current file file1 file2 ------ ------- | static void foo() static int foo() | | { /*...*/} { /*...*/ } | | void F(){ foo();} int G(){ foo();} | ----------------------------------------------- file1.o H file2.o H link H V OK! EXE file1 file2 ------ ------- | void foo() int foo() | | { /*...*/} { /*...*/ } | | void F(){ foo();} int G(){ foo();} | ----------------------------------------------- file1.o H file2.o H link H Linking Error! V EXE BAD...!!! Good luck!! Miguel