Wk. 9 Flashcards

1
Q

What should header files contain and not contain?

A

Declarations. Should not contain code that will allocate space in memory

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

How do you invoke the linker?

A

Providing all of the .o files without the -c (compile only) switch

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

Does the order matter matter when linking .o files?

A

No, the order does not matter. The compiler will still create the a.out file

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

What is object oriented programming?

A

A combination of data and functions to manipulate that data into singular objects

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

What is the syntax for calling a function member?

A

[data type] [Tag Name]::[function identifier][parameter list] (the :: is the prefix)

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

What is the :: prefix called?

A

Scope resolution operator

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

If you want to make a const member function, where does the const go?

A

After the formal parameter list

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

Why is the main function not a member function?

A

It does not have a Tag Name or scope resolution operator.

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

What is the difference between a class and a struct?

A

The default accessibility of their members. Structs are public by default, classes are private by default

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

What does ADT stand for?

A

Abstraction Data Type

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

What is an ADT?

A

Complex data type that contains data alongside functions to manipulate that data. Uses encapsulation to hide implementation details.

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

What are class .cpp files called?

A

Implementation files

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

What is a constructor?

A

A special member function that is called when space is allocated for an object

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

What is the syntax for a constructor?

A

[tag name] : : [function name/same as tag name][parameter list]. There is no return type

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

Can a constructor have a non empty parameter list?

A

Yes, could use defaults arguments from function prototype

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

What is a default constructor?

A

A constructor that does not require explicit arguments in order to execute

17
Q

What happens if a class has no constructors declared?

A

Compiler will generate a default ctor if it is needed.

18
Q

What is a Type Conversion Ctor?

A

A ctor where the 1st parameter is of a different type than the object being created. If there are additional parameters, they must have default arguments.

19
Q

What is a copy ctor?

A

A ctor where the 1st parameter must be a const reference to and existing object of the same type (Cbox referring to another Cbox object) . If there are additional parameters, they must have default arguments.