Dynamic Allocation in C++
All Articles

Dynamic Allocation in C++

C++ provides allocation and deallocation functions ‘new’ and ‘delete’ similar to the malloc() and free() function in C. The main advantage of dynamic allocation is that it allows us to automatically allocate enough memory to hold an object of the specified type and you don’t need to use the ‘sizeof’ operator. Also, you don’t need…

C++ References
All Articles

C++ References

A reference is essentially an implicit pointer that acts as another name for an object. One important use for a reference is to allow you to create functions that automatically use call-by-reference parameter passing rather than C++’s default call-by-value method. When you create a reference parameter, that parameter automatically refers to (implicitly points to) the…