Lectures 7 - 10 Flashcards

(18 cards)

1
Q

Variables are placed on . . .

A

The stack

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

Memory management happens . . .

A

Automatically, at compile time, and when there is little to do.

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

The stack is

A

A small amount of memory managing function calls and automatic variables

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

Heap

A

The rest of the addressable memory

Deal with memory allocation and de-allocation

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

Why should you keep a pointer to the data alive?

A

You won’t be able to free it.

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

The development of programming languages has diverged.

A
  • Imperative/procedural
  • Declarative
  • Functional
  • Object-oriented
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

OO languages

A

Most used paradigm for commercial software.

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

Global (Scope)

A

Visible anywhere.

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

Local (Scope)

A

Visible only in local function/block

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

Object (Scope)

A

Public: Visible from the object
Private: Only visible to the object
Protected: The object and child types

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

Encapsulation

A

Make data inside private

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

Abstraction

A

Only provide essential info to the outside world and hide the internals of the object.

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

Class

A

A template describing what data and methods an object should support

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

Vector

A

Able to get around the problems of arrays

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

Destructor

A

Called when the object is destroyed.

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

Buffer

A

A temporary store for data entered by the user

17
Q

Buffer overflow

A

Fill the array and continue writing until the return address

18
Q

Solutions for attacks.

A
  • Avoid the use of functions that perform unbounded writes.
  • Use fgets instead of gets. Lets you specify the maximum number of characters to read in.
  • Modern compilers and operating systems also offer some protection.
  • Write good code. Writing bad code leads to poor software.