Alias a Record Type with typedef
Several kits use the same record shape. typedef lets you call that anonymous struct type KitRecord, so each declaration can use a short name. This defines a type, not a kit; KitRecord kit creates an object of that type. Access its fields with dot notation.
c
#include <stdio.h>
typedef struct { const char *name; int count; } KitRecord;
int main(void) {
KitRecord kit = {"Brushes", 2};
printf("%s: %d\n", kit.name, kit.count);
return 0;
}
The program prints Brushes: 2. Change kit.count's initial value and run it again; the type name stays the same.