Novice question.
John Gordon
gordon at osiris.cso.uiuc.edu
Wed Nov 14 12:05:11 AEST 1990
jmwojtal at 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 at osiris.cso.uiuc.edu #include <disclaimer.h>
gordon at cerl.cecer.army.mil #include <clever_saying.h>
GEnie: j.gordon14
More information about the Comp.lang.c
mailing list