Answers to questions on typedefs for structs and unions

  1. Declare a typedef for the car part type we used to illustrate unions.

    typedef struct car_part component;
  2. Write a declaration of a variable using the original struct type for car parts and another using the typedef type.
    struct car_part cp1;
    component cp2;
    

Back to the questions.


Back to the notes on typedefs.