User manual

228
mikoC PRO for dsPIC
MikroElektronika
Auto
The auto storage-class specier declares an automatic variable (a variable with a local lifetime). An auto variable is
visible only within the block in which it is declared.
The auto storage-class specier can only be applied to names of variables declared in a block or tonames of function
parameters.
However, these names have automatic storage by default. Therefore the auto storage class specier is usually
redundant in a data declaration.
Register
The register storage-class specier is used to dene local variables that should be stored in a register instead of RAM.
At the moment this modier has no special meaning in mikroC PRO for dsPIC30/33 and PIC24.
mikroC PRO for dsPIC30/33 and PIC24 simply ignores requests for register allocation.
Static
The static storage class specier lets you dene variables or functions with internal linkage, which means that each
instance of a particular identier represents the same variable or function within one le only.
In addition, variables declared static have static storage duration, which means that memory for these variables is
allocated when the program begins running and is freed when the program terminates.
Static storage duration for a variable is different from le or global scope. A variable can have static duration, but local
scope.
Extern
The extern storage class specier lets you declare objects that can be used in several source les. An extern declaration
makes a described variable usable by the succeeding part of the current source le.
This declaration does not replace the denition. It is used to describe a variable that is externally dened. An extern
declaration can appear outside a function or at the beginning of a block.
If the declaration describes a function or appears outside a function and describes an object with external linkage, the
keyword extern is optional.
If a declaration for an identier already exists within the le scope, any extern declaration of the same identier found
within a block refers to the same object.
If no other declaration for the identier exists within the le scope, the identier has external linkage.
See Linkage for more information.