1.3.04c. Pointing mechanism with structures

  • Foreign key importing
    typedef struct car
    {
      int ID;
      char[] make;
      char[] model;
      char[] derivative;
      int optionID;
    } car;
    
    typedef struct option
    {
      int ID;
      char[] name;
      int price;
    } option;
    
    car c;
    option o;
    //...data structure populating
    c.optionID = o.ID;
    

Relational foreign key example in C with Structures