Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!ncar!gatech!udel!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Scope of 'static' variables Keywords: extern, static Message-ID: <14680@smoke.brl.mil> Date: 7 Dec 90 19:32:11 GMT References: <7744.27500de8@jetson.uh.edu> <2175@tuvie> <1990Dec7.051955.2883@mintaka.lcs.mit.edu> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 16 In article <1990Dec7.051955.2883@mintaka.lcs.mit.edu> dstailey@gnu.ai.mit.edu (Doug Stailey) writes: >But what if you want to call a function returning a static from another >source module? Say for instance, in main.c you have a function declared: >static char *get_cmd(FILE *fp) "static" applies to the function; it has NOTHING to do with the value returned. Thus "function returning a static" is incorrect terminology. "The function is statically defined" would be acceptable. extern char *example(void); char *example(void) { static char buffer[100]; /*...*/ return buffer; }