Example C code using pointers

  1. Integer Pointers
    A simple example that shows what a pointer is.
  2. Arrays of arbitrary lengths
    This example shows how to construct arrays of arbitrary lengths using pointers.
  3. Passing variables by reference
    If we have a variable x and we pass the address of x to a function, then that function can edit the value of x.
  4. Pointers and structures
    This example shows how to work with pointers to structures.
  5. A polygon example
    This provides an example of a self-referential pointer.

I use c2html to convert c code to colored html.