Chapter 2 Vocab Flashcards
built-in functions
prewritten functions that exist in libraries
variable declaration
binds a name to a memory location and describes the attributes of the value being stored there
pointer
the name of an address
enumeration type
used for variables that can take enumerable ordered set of values
typedef enum {…}
lazy evaluation policy
an expression will be evaluated only if its value is needed
array
a homogeneous collection of data elements that are stored in a consecutive block of memory locations
user defined functions
functions written by the programmer
global function/variable
a function/variable that exists outside of any function
scope rule
the scope of a variable is from declaration to the end of the block defined by {}
multi-scan compilation
the compiler scans the program multiple times
forward declaration
makes the name of a function known in advanced and must include:
- the return type
- name of the function
- the parameter types
- the names of the parameters
basic data types
char, int, float, double, void
basic modifiers
long, short, signed, unsigned, register
union type variable
a region of shared memory that, over time, can contain different types of values
can only contain one value at any given moment
static memory allocation
memory locations are statically allocated by the complier during compilation time allowing the memory for the variables to already be available when we want to store data in them
for arrays, you must know the maximum number of elements in advance
dynamic memory allocation
allocates memory to variables during the execution by the function call
void *malloc(size_t size);
size_t is usually an unsigned int and specifies the number of bytes to be allocates
heap
a pool of free memory
memory leak
not collecting garbage as necessary
stack
a data structure that can contain a set of ordered items
items can be inserted and removed from one end called the top of the stack
functions
named blocks of code that must be explicitly called
in-passing
passing variables to a function
out-passing
passing values out of a function
formal parameters
the parameters used when defining a function
local variables to the function
actual parameters
the values or variables we use to substitute for the formal parameters when we call a function
call-by-value
the formal parameter is initialized to the value of the actual parameter
call-by-address
the address of the parameter is passed into the local variable of the function
call-by-alias
the formal parameter is an alias of the actual parameter