Step Into Labs

Step Into C · Lesson 15 · Modeling Data

Function Pointers

Functions as values, typedefs, callbacks, qsort and dispatch tables.

Part of Step Into C. The full lesson, its missions and the real compiler and debugger are in the course. Try a free lesson first to see how it works.

Compiled code lives in memory like everything else, so every function has an address. A function pointer stores that address and lets you call the function indirectly.

In this lesson

Missions

  1. Point at a function
  2. Callback
  3. Sort with qsort
  4. Dispatch table