C++ Flashcards
Pointer to constant data
const int * a; int const * a;
Pointer with constant memory address
int * const a = 0xFFFFFFFF;
Pointer to constant data and constant address
const int * const a = 0xFF; int const * const a = 0xFF;
In-line IF (conditional operator)
condition ? trueResult : falseResult
Comma Operator
a = (b=3, b+2); -> b=3; a=b+2;
Function Pointer
int (*fn)(int,int)
Operator Overloading
ReturnType operator + (OperandType);
ReturnType ClassName::operator+ (OperandType x) { }
static Class Members
Shared by all instances of the class
friend Functions
These are allowed to have access to private and protected class members
friend Class
These are allowed to have access to private and protected class members
What are not inherited?
constructor, destructor, operator overloads, friends
Inheritence Syntax
class X: public Y, public Z {}
virtual Members
Class member that can be redefined in child classes
Templates
template functionOrClass;
dynamic_cast
Cast of pointer from dervied to base class, checks that the object will be compatible