Test 2 Flashcards

(50 cards)

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:

22
Q

streams version of get()

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
a derived class pointer can always be assigned to
a base class pointer
26
a base class pointer can point to a derived class with the use of a
type cast
27
a function is polymorphic if
different types of data produce different behavior
28
when the compiler selects the code that should be executed when the function name is invoked
binding
29
code gets selected at compile time
static binding
30
code gets selected at run time
dynamic binding
31
a member function for which the class provides no implementation
pure virtual function (PVF)
32
PVF is also called
an abstract function
33
a class with a PVF is
an abstract class
34
are abstract classes allowed
No
35
the type of derived class is a special case of the base class
class inheritance
36
when a class contains an obj of another class as a member var
class composition
37
"is-a" relationship
class inheritance
38
"has-a" relationship
class composition
39
which is preferred? inheritance or composition
composition
40
empty class used for throwing
exception class
41
"generic" function that can work with different data types
function template
42
template
template prefix
43
two structures in the STL are the
containers and iterators
44
two types of containers in the STL
sequential and associative containers
45
types of sequential containers
vectors, deque, list
46
adds memory to the BEGINNING of an array
deque
47
linked structure
list
48
like an array
vector
49
associative containers
set, multiset, map, multimap
50
items used to access items stored in containers
iterators