Null pointers in a Binary tree

Given a Binary Tree with n Nodes (you may arrange these nodes any way you want to). How many NULL pointers will be there ? […]

Difference between malloc, calloc, free and realloc functions

Functions malloc, calloc, realloc and free are used to allocate /deallocate memory on heap in C/C++ language. These functions should be used with great caution […]

Memory leaks and dangling pointers

Those who use languages like C and C++ that support user defined pointer variables, put utmost emphasis on implementing the pointers correctly. And rightfully so, […]

Separate nullptr in C++11

In my earlier articles on C++, I have written about the automatic type detection, uniform initialization list and Range based for loopin C++11. Earlier we […]

Changing pointer passed to a function as argument

If a function in C/C++ takes a pointer argument and we try to change it (Not the value pointed to by pointer but the pointer […]

Freeing memory allocated to n-dim array using free

Yesterday we learned about how to allocate memory on heap for an n-dim array using Malloc. Today let us see how to deallocate the memory […]

Allocating memory to n-dim Array on heap

Dynamic arrays are on heap. If an array is stored on heap, its address must be stored in pointer variables, else there will be no […]

difference between reference & pointers in C++

What is the difference between reference & pointers in C++? Is it safe to use pointers in places where we use reference & vice-versa?