Novice question.

Matthew Farwell dylan at ibmpcug.co.uk
Wed Nov 14 22:06:38 AEST 1990


In article <1990Nov14.010511.7241 at ux1.cso.uiuc.edu> gordon at osiris.cso.uiuc.edu (John Gordon) writes:
>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).

Surely this should be 'might be stored in a high speed register', depending
on whether the compiler wants to put it there, is able to put it there,
whether there is an s in the day today, etc. etc. I always thought that
register was just advice to the compiler, which its free to ignore if it
wants to or is unable to fulfil the request.

Dylan.
-- 
Matthew J Farwell                 | Email: dylan at ibmpcug.co.uk
The IBM PC User Group, PO Box 360,|        ...!uunet!ukc!ibmpcug!dylan
Harrow HA1 4LQ England            | CONNECT - Usenet Access in the UK!!
Phone: +44 81-863-1191            | Sun? Don't they make coffee machines?



More information about the Comp.lang.c mailing list