10- void-functions, predicates, call-by-reference Flashcards

1
Q

Void function

A

does not return a value, can only be used as a standalone statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

void

A

specified as return type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Predicate

A

function whose return value is boolean
used to compute a binary decision
idiom: use a predicate as an expression in a looping or branching construct

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Variable memory allocation

A

assigning memory location to a variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Function frame

A

unit of memory allocation for function’s local variables
contains memory for (local variables), parameters, return value
all variables are allocated at once: frame is allocated as a unit
active frame – frame of currently executing function
inactive frame – others

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Program (call) stack

A

means of memory allocation to local function variables during program execution
allocates function frames
last-in/first-out (LIFO) data structure
active frame – on top of the stack
two operations:
push – inserts the frame of invoked function, makes it active
pop – removes the frame of ending function, makes the frame below it active

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

call-by-reference

A

parameter passing discipline that allows the function to modify the arguments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly