Skip to main content

Pointers for C Programmings

Pointers are variables that hold memory addresses, and they are the central idea of C. This unit covers address-of and dereference operators, pointer arithmetic, the link between arrays and pointers, and dynamic memory with malloc, calloc, realloc and free for data whose size is known only at run time.

Stage: Memory · Part of the C Programming roadmap · Last reviewed 19 November 2026

What to learn in Pointers

Pointers interview questions

What is a dangling pointer?

A dangling pointer refers to memory that is no longer valid, such as after free or when pointing to a local variable that went out of scope. Using it is undefined behaviour. Setting a pointer to NULL after freeing helps avoid it.

What is the difference between malloc and calloc?

malloc allocates a block of given size with uninitialised contents. calloc takes a count and element size, allocates the block and zeroes it, and can detect multiplication overflow. Both return NULL on failure and need free.

Where Pointers fits in the C Programming roadmap

Pointers belongs to the Memory stage (intermediate level), which takes about 30 hours. Pointers and the heap.

Back to the full C Programming roadmap