#note needs editing, possibly redundant
void C++
- When used as a function return type, the void keyword specifies that the function does not return a value. When used for a function’s parameter list, void specifies that the function takes no parameters. When used in the declaration of a pointer, void specifies that the pointer is “universal.”
- If a pointer’s type is void *, the pointer can point to any variable that is not declared with the const or volatile keyword. A void pointer cannot be dereferenced unless it is cast to another type. A void pointer can be converted into any other type of data pointer.
- A void pointer can point to a function, but not to a class member in C++.
void vobject; // C2182
void *pv; // okay
int *pint; int i;
int main() {
pv = &i;
// Cast optional in C required in C++
pint = (int *)pv;
Volatile C++
- A type qualifier that you can use to declare that an object can be modified in the program by the hardware.
volatile declarator ;
virtual C++
- The virtual keyword declares a virtual function or a virtual base class.
virtual [type-specifiers] member-function-declarator
virtual [access-specifier] base-class-name
Parameters
- type-specifiers Specifies the return type of the virtual member function.
- member-function-declarator Declares a member function.
- access-specifier Defines the level of access to the base class, public, protected or private. Can appear before or after the virtual keyword.
- base-class-name Identifies a previously declared class type
this pointer
- The this pointer is a pointer accessible only within the nonstatic member functions of a class, struct, or union type. It points to the object for which the member function is called. Static member functions do not have a this pointer.
this->member-identifier