|Reference behaves like an alias for an existing variable, i.e., it is a temporary variable.
|The pointer is a variable which stores the address of a variable.
|Reference variable does not require any indirection operator to access the value. A reference variable can be used directly to access the value.
|Pointer variable requires an indirection operator to access the value of a variable.
|Once the reference variable is assigned, then it cannot be reassigned with different address values.
|The pointer variable is an independent variable means that it can be reassigned to point to different objects.
|A null value cannot be assigned to the reference variable.
|A null value can be assigned to the reference variable.
|It is necessary to initialize the variable at the time of declaration.
|It is not necessary to initialize the variable at the time of declaration.
new() is a preprocessor while
malloc() is a function.
malloc() you have to use
malloc() gives random value in the newly allotted memory location.
new() operator allocates the memory and calls the constructor for the object initialization and
malloc() function allocates the memory but does not call the constructor for the object initialization.
new() operator is faster than the
malloc() function as operator is faster than the function.
terminate() function is invoked during Stack Unwinding on a destructor for a unhandled exception.
inline return_type function_name( arguments )
// BODY OF THE FUNCTION