Week 9 - C++ Flashcards

1
Q

What does the scope constructor :: do?

A

Defines member functions outside declaration -> specifies the scope of member functions, classes and namespaces

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

What does a class constructor do in C++?

A

Malloc memory to pointers

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

What does a class destructor do in C++?

A

Free memory allocated to pointers

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

What is the C++ version of malloc and free?

A

new and delete

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

What is “this” in C++?

A

A pointer to the current object

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

What does the copy constructor do in C++?

A

A member function that initialises an object using another object of the same class

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