C Programming

DECLARING VARIABLES TO BE REGISTER BASED
Some routines may be time or space critical. Variables can be defined as being register based by the following declaration,


	register int index;


DECLARING VARIABLES TO BE EXTERNAL
Here variables may exist in separately compiled modules, and to declare that the variable is external,


	extern  int  move_number;

This means that the data storage for the variable move_number resides in another source module, which will be linked with this module to form an executable program. In using a variable across a number of independently compiled modules, space should be allocated in only one module, whilst all other modules use the extern directive to access the variable.


ęCopyright B Brown. 1984-1999. All rights reserved.