1/41
Looks like no tags are added yet.
Variables
abstraction of a computer memory cell or collection of memory cells
Variables
collection of attributes
Names
string of characters used to identify some entity
Identifiers
another name for names
Names
they can be keyword, reserved word, variable name, function name, etc.
Variable Names
most common names in programs are _ _
Address
it is the machine memory address associated with the variable
L Value
another name for address
Multiple Address
one variable may have _ _
Same Address
multiple variable may have access to the _ _
Type
determines the range of values the variable can store
Value
contents of the memory cells associated with the variable
R Value
another name for value
Lifetime
the time during which the variable is bound to a specific memory location
Allocate memory for variable
lifetime, step (1)
Bound memory cells to variable
lifetime, step (2)
Use variable
lifetime, step (3)
Unbound memory cells
lifetime, step (4)
Deallocate memory of the variable
lifetime, step (5)
Scope
range of statement in which the variable is visible
Bindings
association between an attribute and entity
Bindings
the time in which binding takes placed is called binding time
Early Binding
bindings are done during translation
Late Binding
bindings are done during run-time
Efficiency
early binding focuses on
Flexibility
late binding focuses on
Static Binding
bindings that occurs before run-time and does not change
Dynamic Binding
binding are done before/ during run-time and can change during execution
Type Binding
it is the binding of variable to a data type
Data Type Binding
another name for type binding
Declarations
type binding, data types are bound using _
Explicit declaration
the data type is specified in the variable declaration
Implicit declaration
data type is not specified in the declaration but inferred based on literals or some conventions
Type Binding
implicit declaration decreases the reliability of a program since it prevents the compilation process to detect possible type errors
Static Type Binding
the data type is assigned during translation, and does not change during execution
Dynamic Type Binding
variable is bound to a type during execution (and may be rebound)
More flexible
dynamic type binding makes the program _ _ since it allows a variable to change types
Error Detection Capability
_ _ _decreases since types are not checked beforehand
Storage Binding
binding of memory locations to a variable
Allocation
process of taking memory cells from the pool of available memory
Deallocation
process of putting back the unbound memory to the available memory pool
Storage Binding
the lifetime of a variable is defined by when the _ _ occurred