Datasheet

CONCEPTS
This section covers some basic concepts of language, essential for understanding
of how C programs work. First, we need to establish the following terms that will be
used throughout the help:
- Objects and lvalues
- Scope and Visibility
- Name Spaces
- Duration
OBJECTS
An object is a specific region of memory that can hold a fixed or variable value (or
set of values). This use of a term object is different from the same term, used in
object-oriented languages, which is more general. Our definiton of the word would
encompass functions, variables, symbolic constants, user-defined data types, and
labels.
Each value has an associated name and type (also known as a data type). The
name is used to access the object and can be a simple identifier or complex expres-
sion that uniquely refers the object.
Objects and Declarations
Declarations establish a necessary mapping between identifiers and objects. Each
declaration associates an identifier with a data type.
Associating identifiers with objects requires each identifier to have at least two attrib-
utes: storage class and type (sometimes referred to as data type). The mikroC PRO
for AVR compiler deduces these attributes from implicit or explicit declarations in the
source code. Usually, only the type is explicitly specified and the storage class spec-
ifier assumes the automatic value auto.
Generally speaking, an identifier cannot be legally used in a program before its dec-
laration point in the source code. Legal exceptions to this rule (known as forward ref-
erences) are labels, calls to undeclared functions, and struct or union tags.
The range of objects that can be declared includes:
142
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Language Reference
mikroC PRO for AVR
CHAPTER 5