Memory allocation of pointers
Memory allocation of pointers: Memory allocation is done in two ways 1. Static memory allocation 2. Dynamic memory allocation Static memory allocation: · The amount of memory to be allocated is pre known. · The memory is allocated during compilation time. · Ex: int a; // allocates 2 bytes. · Variable remains permanently allocated. Dynamic memory allocation: · Memory is allocated during the execution of the program. · C++ supports dynamic allocation and de allocation of objects using the new and delete operations. new operator: · We can allocate storage for a variable while program is running by using new operator. · Ex: ...