Structures

The simplest way to declare a structure


  struct {   
    int nume;
    int deno;
  } frac1;

But notice that we can't do this:


  struct {   
    int nume;
    int deno;
  };   // Error: doesn't declare anything

A better way is to do


  struct fraction {   
    int nume;
    int deno;
  } frac1;
  struct fraction frac2;

struct fraction {   
  int nume;
  int deno;
};
struct fraction frac1, frac2;