Ch. 4.15: More about Blocks and Variable Scope Flashcards

1
Q

What is the scope of a variable?

A

The scope of a variable is limited to the block in which it is defined.

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

What is local or block scope?

A

Variables defined inside a set of braces have local scope or block scope.

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

What does leaving or going out of scope mean?

A

The variable may no longer be used.

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