Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!hao!oddjob!gargoyle!ihnp4!laidbak!daveb From: daveb@laidbak.UUCP (Dave Burton) Newsgroups: comp.lang.c Subject: Re: static stuff... Message-ID: <1255@laidbak.UUCP> Date: Wed, 18-Nov-87 22:08:02 EST Article-I.D.: laidbak.1255 Posted: Wed Nov 18 22:08:02 1987 Date-Received: Sun, 22-Nov-87 20:11:24 EST References: <3011@sigi.Colorado.EDU> Reply-To: daveb@laidbak.UUCP (Dave Burton) Organization: is pretty bad/My method of Lines: 21 In article <3011@sigi.Colorado.EDU> swarbric@tramp.Colorado.EDU (SWARBRICK FRANCIS JOHN) writes: >First, what is the significance of making a static function? > >Second, aren't all global variables automatically static. Is there any >reason to explicitly call them static? Static has two meanings in C: 1. opposite of dynamic 2. do not export symbol To answer both your questions: Declare global objects (that includes function names) static to prevent them from being seen outside of the file they live in. Proper use of static in large, multiple file programs helps prevent symbol collision. -- --------------------"Well, it looked good when I wrote it"--------------------- Verbal: Dave Burton Net: ...!ihnp4!laidbak!daveb V-MAIL: (312) 505-9100 x325 USSnail: 1901 N. Naper Blvd. #include Naperville, IL 60540