SW500010 Microchip Technology, SW500010 Datasheet - Page 80

HI-TECH C PRO FOR PIC10/12/16

SW500010

Manufacturer Part Number
SW500010
Description
HI-TECH C PRO FOR PIC10/12/16
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC10/12/16r
Datasheets

Specifications of SW500010

Supported Families
PIC10, PIC12, PIC16
Core Architecture
PIC
Software Edition
Professional
Kit Contents
Software And Docs
Mcu Supported Families
PIC10/12/16
Tool Type
Compiler
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
PIC10, PIC12, PIC14, PIC16, PIC16E
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
019P
778-1006
778-1006
Supported Data Types and Variables
3.3.8.2 Structure and Union Qualifiers
HI-TECH C supports the use of type qualifiers on structures. When a qualifier is applied to a struc-
ture, all of its members will inherit this qualification. In the following example the structure is
qualified const.
In this case, the structure will be placed into the program space and each member will, obviously, be
read-only. Remember that all members must be initialized if a structure is const as they cannot be
initialized at runtime.
the structure would be positioned into RAM, but each member would be read-only. Compare the
following structure with the above.
3.3.9 Standard Type Qualifiers
Type qualifiers provide information regarding how an object may be used, in addition to its type
which defines it storage size and format. HI-TECH C supports both ANSI qualifiers and additional
special qualifiers which are useful for embedded applications and which take advantage of the PIC
architecture.
3.3.9.1 Const and Volatile Type Qualifiers
HI-TECH C supports the use of the ANSI type qualifiers const and volatile.
be modified. If any attempt is made to modify an object declared const, the compiler will issue a
warning. User-defined objects declared const are placed in a special psects in the program space.
Obviously, a const object must be initialised when it is declared as it cannot be assigned a value at
any point at runtime. For example:
80
If the members of the structure were individually qualified const but the structure was not, then
The const type qualifier is used to tell the compiler that an object is read only and will not
const struct {
} record = { 0x55, &i};
struct {
} record = { 0x55, &i};
const int
int number;
int * ptr;
const int number;
int * const ptr;
version = 3;
C Language Features

Related parts for SW500010