Pointer (C++)

A pointer is a variable that stores the memory address of another value rather than the value itself. You use * to declare a pointer and to read the value it…