Structure pointer example

This example shows the use of pointers to structures and pointer arithmetic.

The code includes 4 different ways of printing a struct array. All these ways give the same result. Which one to use depends on the needs as well as personal preferences and team requirements.

Some notes for comparing this code to the square bracket array notation:

  • In PrintEmployees1() , you could use pEmployees[i].member  instead.
  • In PrintEmployees3() , you could pass pEmployees[i]  instead (but not pEmployee[i] ).