c++ Flashcards
What two lines usually precede every source file?
#include using namespace std;
does an array in c++ have a length field like java?
No
What does the header file contain in c++?
class/function declarations
What should member variables start with?
m_
When is a destructor executed?
When the instance of the constructor is overwritten
What is inlining in c++ and in java?
declaring body and header of a function on the same line
When overloading a function does the @overload need to precede the declaration?
No
What type is null?
int
What is the syntax for default parameters?
type function_name (type a, type b = value)
If B is a superclass of A, what is the syntax for inheritance?
class B : public A
Can a class inherit more than one class?
Yes
If the subclass method has to overwrite from the superclass what keyword must be used?
virtual
In the superclass, how is an abstract method defined?
virtual type name() = 0;
What is a pointer?
a memory address
How is a pointer defined?
int* name;