User manual
228
mikoC PRO for dsPIC
MikroElektronika
Auto
The auto storage-class specier 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 specier 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 specier is usually
redundant in a data declaration.
Register
The register storage-class specier is used to dene local variables that should be stored in a register instead of RAM.
At the moment this modier 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 specier lets you dene variables or functions with internal linkage, which means that each
instance of a particular identier 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 specier 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 denition. It is used to describe a variable that is externally dened. 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 identier already exists within the le scope, any extern declaration of the same identier found
within a block refers to the same object.
If no other declaration for the identier exists within the le scope, the identier has external linkage.
See Linkage for more information.