Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!acf3!hazzah From: hazzah@acf3.NYU.EDU (Ali Hazzah) Newsgroups: comp.lang.c Subject: C pointer to a function Message-ID: <501@acf3.NYU.EDU> Date: Sat, 26-Sep-87 11:16:30 EDT Article-I.D.: acf3.501 Posted: Sat Sep 26 11:16:30 1987 Date-Received: Sun, 27-Sep-87 10:46:43 EDT Distribution: na Organization: New York University Lines: 35 Keywords: static pointer function Consider the function foo, defined as: static char *foo(name) char *name; { static char path[20]; char *strcat(); ... return(strcat(path, name); } and invoked in the following manner: callfoo() char *name; { char *path, *foo(); ... path = foo(name); ... } The question here concerns the scope of the pointer to the function foo. Specifically, why might the pointer be defined as static? (An example of this can be found on p.23 of Marc Rochkind's book, "Advanced Unix Programming", 4th printing.)