C++ Pointers Practice Questions

All About Code
2 min readMay 15, 2022

1. What is a pointer?

A pointer is a variable that stores the memory address of an object. Pointers are used extensively in both C and C++ for three main purposes: to allocate new objects on the heap, to pass functions to other functions. to iterate over elements in arrays or other data structures.

2. Do pointers have a data type?

Yes. Like regular variables, pointers have a data type. For example, a pointer of type integer can hold the address of a variable of type integer. A pointer of…

--

--