previous | index | next

Using typedefs

Rather than referring to gameState pointers as type gameState*, we can use the C++ typedef declaration to simplify:

struct gameStateInfo {
  int pile1;
  int pile2;
};

typedef gameStateInfo* gameState;

Here, gameState is defined to be the name for the type gameStateInfo*, where gameStateInfo is the actual struct type.


previous | index | next