Test 2 Flashcards

1
Q

a function that calls itself

A

recursive function

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

depth of recursion

A

the number of times a recursive function will be called

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

stops a recursive function

A

base case

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

direct recursion

A

a function that calls itself

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

indirect recursion

A

2 functions that recursively call each other

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

used for file output

A

ofstream

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

used for file input

A

ifstream

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

used for both file I/O

A

fstream

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

a sequence from which data can be read

A

input stream

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

a sequence to which data can be written

A

output stream

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

used for reading/writing strings

A

stringstream

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

flushing the buffer

A

file data is written to the disk upon closing the file

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

to continue file operations once it has been read through

A

file.clear()

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

defines how a file can be used

A

file open mode

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

file open modes

A

app, ate, binary, in, out, trunc

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

what is the vertical line ( | ) symbol?

A

binary or

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

what are the I/O manipulators

A

setw(), fixed, show point, setprecision(), left, right

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

file condition bit flags

A

eofbit, failbit, hardfail, badbit, goodbit

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

standard delimit char for&raquo_space;

A

whitespace

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

standard delimit char for get line()

A

‘\n’

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

member functions that can be used to read single characters:

A

get

22
Q

streams version of get()

A

put()

23
Q

“places” for seekg()

A

beg, cur, end

24
Q

to “rewind” a file from the end

A

file. clear();

file. seekg(0L, ios::beg);

25
Q

a derived class pointer can always be assigned to

A

a base class pointer

26
Q

a base class pointer can point to a derived class with the use of a

A

type cast

27
Q

a function is polymorphic if

A

different types of data produce different behavior

28
Q

when the compiler selects the code that should be executed when the function name is invoked

A

binding

29
Q

code gets selected at compile time

A

static binding

30
Q

code gets selected at run time

A

dynamic binding

31
Q

a member function for which the class provides no implementation

A

pure virtual function (PVF)

32
Q

PVF is also called

A

an abstract function

33
Q

a class with a PVF is

A

an abstract class

34
Q

are abstract classes allowed

A

No

35
Q

the type of derived class is a special case of the base class

A

class inheritance

36
Q

when a class contains an obj of another class as a member var

A

class composition

37
Q

“is-a” relationship

A

class inheritance

38
Q

“has-a” relationship

A

class composition

39
Q

which is preferred? inheritance or composition

A

composition

40
Q

empty class used for throwing

A

exception class

41
Q

“generic” function that can work with different data types

A

function template

42
Q

template

A

template prefix

43
Q

two structures in the STL are the

A

containers and iterators

44
Q

two types of containers in the STL

A

sequential and associative containers

45
Q

types of sequential containers

A

vectors, deque, list

46
Q

adds memory to the BEGINNING of an array

A

deque

47
Q

linked structure

A

list

48
Q

like an array

A

vector

49
Q

associative containers

A

set, multiset, map, multimap

50
Q

items used to access items stored in containers

A

iterators