www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/27/05:38:18

From: Bob AT ge DOT chem DOT binghamton DOT edu (Bob Kematick)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: C & static
Date: 24 Apr 1997 15:33:47 GMT
Organization: Binghamton University
Lines: 44
Message-ID: <5jnugr$8cu2@bingnews.binghamton.edu>
References: <01bc5055$7a3d2100$08b0f8ce AT didi> <5jnbhc$or AT star DOT cs DOT vu DOT nl>
NNTP-Posting-Host: ge.chem.binghamton.edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Ruiter de M (mdruiter AT cs DOT vu DOT nl) wrote:
: Ian Mausolus (mausolus AT ican DOT net) wrote:
: : What is the significance of the word "static" in front of a function name
: : in C?

[ snip ]

: That means, that the function is declared local to the file. No other file
: can use it (by means of a .h-file).

[ snip again]

Nonsense.


Linux 2.0.27.
ge:~$ 

ge:~$ cat head.h
static void foo ( int *i )
{
*i=12345;
}

ge:~$ 
ge:~$ cat myprog.c
#include "head.h"
#include <stdio.h>

void main()
{
int j;
foo(&j);
printf ("foo is %d \n",j);
}

ge:~$ 
ge:~$ gcc myprog.c
ge:~$ a.out
foo is 12345 
ge:~$ 



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019