Interview Question

What is a pointer?

A pointer can designate an object or function and must be valid before dereferencing.

💡 Concept ✅ Quick Revision ⚙ C

Answer

A pointer is a value that designates an object or function, or is a null pointer. • A pointer type records the type of the designated entity. • The address operator `&` obtains an object address when permitted. • Dereferencing an invalid or null pointer has undefined behavior.

💡 C Example

int value = 42; int *pointer = &value; *pointer = 50;

⚡ Quick Revision

A pointer can designate an object or function and must be valid before dereferencing.