Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!julius.cs.uiuc.edu!ux1.cso.uiuc.edu!osiris.cso.uiuc.edu!gordon From: gordon@osiris.cso.uiuc.edu (John Gordon) Newsgroups: comp.lang.c Subject: Re: Novice question. Message-ID: <1990Nov14.010511.7241@ux1.cso.uiuc.edu> Date: 14 Nov 90 01:05:11 GMT References: <1990Oct31.014132.2400@agate.berkeley.edu> <336@brat.UUCP> <3838@vela.acs.oakland.edu> Sender: news@ux1.cso.uiuc.edu (News) Organization: University of Illinois at Urbana Lines: 21 jmwojtal@vela.acs.oakland.edu (Wojo) writes: >What exactly are the reasons "register" and "extrn" are used to declare >values. I see register alot in some of the programs and I don't know why >they do it. Is it just good practice or what. "register" means that the variable will be stored in a portion of memory that can be accessed significantly faster than normal. Useful for loop counters, among other things. There are a limited number of registers available. MS-DOS machines, for example, have around 16 (I think). "extern" means that the variable is global, and was declared in a separate .c file. If your program occupies only 1 file, you will never use this. --- John Gordon Internet: gordon@osiris.cso.uiuc.edu #include gordon@cerl.cecer.army.mil #include GEnie: j.gordon14