This code is possible:
int arrA[5] = {1, 2, 3, 4, 5};
int arrB[5] = arrA;
What is no?
True/False: Call-by-value uses pointers to change the values of contents of memory.
What is true?
This keyword overrides a virtual function
What is override?
These are the four pillars of Object Oriented Programming.
What are abstraction, encapsulation, inheritance, polymorphism?
If you use cin for the following string: “hiThere?Bob%how AreYou?” what will the cin read in?
What is hiThere?Bob%how?
int arrA[5];
True or False: &arrA[0] is equivalent to arrA
What is true?
When dealing with pointers, this is the difference between * and &?
Various answers.
This keyword gives ordinary functions access to private members
Friend
In a descendent, which of these functions are inherited:
Constructor
Destructor
Setters
Assignment operator
Name a difference between classes and structs.
"The only difference is that class members and inheritance are private by default and struct members and inheritance are public by default."
Assume you have an object Rational. If you write Rational arrA[10], what are the objects initialized to?
They’re not initialized until you actually create them.
The default constructor
0
What is 2?
What is wrong with this code:
int main() {
Rational *r = new Rational();
r->display();
return 0;
}
No delete statement
This keyword uses late binding to make an entry into a in the virtual table tolookup the function at runtime based on object.
What is virtual?
The relationship between base and derived is known as;
Is-a
Has-a
Was-a
None of the above
What is is-a?
A class with a pure virtual function is known as:
Virtual class
Abstract class
Complex class
Protected class
What is an abstract class?
When creating a function dealing with an array, you should include these two parameters.
What are the array and the size of the array?
True or false: To avoid the slicing problem, you should use call-by-value in your object functions.
This keyword limits the scope, but puts it in global space
What is static?
True/false: you can access protected functions in the derived class.
What is true?
Which of these operators cannot be overloaded:
+
%
>>
None of the above.
What is none of the above?
This removes the last value from a vector
.remove()
.push_back()
.pop_back()
.delete()
What is pop_back()?
Fill in the blank:
Rational r;
Rational *rPoint = &r;
*rPoint[blank]print();
What is ->?
Explain the difference between the static and instance function of a class
Varied answers
True/false: when destructing an inherited object, parents are destructed before children.
What is false?
What’s the correct code to create a template prefix?
template <class TypeName>
template <typename TypeName>