C++ Pointers Explained Simply

A pointer is just an address. Learn declaring, dereferencing and avoiding common mistakes.

By Dr. Dev2026-02-168 min read
βš™οΈ

What is a pointer?

A pointer stores the memory address of another variable.

int x = 10;
int* p = &x;   // p holds x's address
*p = 20;       // x is now 20

Common mistakes

Never use a pointer that is uninitialised or already deleted. Prefer std::unique_ptr in modern C++.

Related articles