Answers

Question and Answer:

  Home  C++ Pointers and Functions

⟩ Explain pointer with examples?

A pointer is a variable that holds a memory address. This address is the location of another object (typically, a variable) in memory. That is, if one variable contains the address of another variable, the first variable is said to point to the second.

A pointer declaration consists of a base type, an *, and the variable name. The general form of declaring a pointer variable is:

type *name;

type is the base type of the pointer and may be any valid type.

name is the name of pointer variable.

The base type of the pointer defines what type of variables the pointer can point to.

 198 views

More Questions for you: