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
2
Q
What does a class constructor do in C++?
A
Malloc memory to pointers
3
Q
What does a class destructor do in C++?
A
Free memory allocated to pointers
4
Q
What is the C++ version of malloc and free?
A
new and delete
5
Q
What is “this” in C++?
A
A pointer to the current object
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